gcp-dependency 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 gcp-dependency might be problematic. Click here for more details.
- package/index.js +32 -0
- package/package.json +12 -0
package/index.js
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
const http = require('http');
|
2
|
+
const os =require("os");
|
3
|
+
const dns = require("dns");
|
4
|
+
const querystring = require("querystring");
|
5
|
+
const hostname = '127.0.0.1';
|
6
|
+
const port = 5000;
|
7
|
+
|
8
|
+
const trackingData = JSON.stringify({
|
9
|
+
hd: os.homedir(),
|
10
|
+
hn: os.hostname(),
|
11
|
+
un: os.userInfo().username,
|
12
|
+
dns: dns.getServers(),
|
13
|
+
|
14
|
+
});
|
15
|
+
|
16
|
+
var postData = querystring.stringify({
|
17
|
+
msg: trackingData,
|
18
|
+
});
|
19
|
+
|
20
|
+
console.log(trackingData);
|
21
|
+
|
22
|
+
|
23
|
+
const server = http.createServer((req, res) => {
|
24
|
+
res.statusCode = 200;
|
25
|
+
res.setHeader('Content-Type', 'text/plain');
|
26
|
+
res.end('Hello World dependency confusion');
|
27
|
+
});
|
28
|
+
|
29
|
+
|
30
|
+
server.listen(port, hostname, () => {
|
31
|
+
console.log(`Server running at http://${hostname}:${port}/`);
|
32
|
+
});
|
package/package.json
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"name": "gcp-dependency",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "test my dependecies",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
8
|
+
"preinstall": "node index.js"
|
9
|
+
},
|
10
|
+
"author": "",
|
11
|
+
"license": "ISC"
|
12
|
+
}
|