-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdomain.html
More file actions
489 lines (432 loc) · 18.2 KB
/
domain.html
File metadata and controls
489 lines (432 loc) · 18.2 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Domain Report — Friday Tools</title>
<meta name="description" content="Complete domain investigation: DNS records, WHOIS data, TLS certificate details, and HTTP probe. All from one page.">
<style>
:root {
--bg: #0a0a0f;
--surface: #12121a;
--border: #1e1e2e;
--text: #c8c8d4;
--text-dim: #6e6e82;
--accent: #7c9cff;
--accent-dim: #4a6abf;
--green: #7cda9e;
--amber: #dab87c;
--red: #da7c7c;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
background: var(--bg);
color: var(--text);
font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Cascadia Code', monospace;
font-size: 15px;
line-height: 1.7;
min-height: 100vh;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 4rem 2rem;
}
h1 {
font-size: 1.3rem;
color: var(--accent);
margin-bottom: 0.5rem;
}
.subtitle {
color: var(--text-dim);
font-size: 0.85rem;
margin-bottom: 2rem;
}
.input-row {
display: flex;
gap: 0.5rem;
margin-bottom: 2rem;
}
input[type="text"] {
flex: 1;
background: var(--surface);
border: 1px solid var(--border);
color: var(--text);
padding: 0.75rem 1rem;
font-family: inherit;
font-size: 1rem;
border-radius: 4px;
outline: none;
}
input[type="text"]:focus {
border-color: var(--accent-dim);
}
button {
background: var(--accent-dim);
color: #fff;
border: none;
padding: 0.75rem 1.5rem;
font-family: inherit;
font-size: 0.9rem;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background: var(--accent);
}
button:disabled {
opacity: 0.5;
cursor: wait;
}
.section {
margin-bottom: 2rem;
}
.section h2 {
font-size: 0.85rem;
font-weight: 600;
color: var(--text-dim);
text-transform: uppercase;
letter-spacing: 0.08em;
margin-bottom: 0.75rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
.section h2 .badge {
font-size: 0.7rem;
padding: 0.1rem 0.4rem;
border-radius: 3px;
text-transform: none;
letter-spacing: 0;
}
.badge-ok { background: #1a3a1a; color: var(--green); }
.badge-warn { background: #3a3a1a; color: var(--amber); }
.badge-err { background: #3a1a1a; color: var(--red); }
.badge-loading { background: #1a1a2a; color: var(--accent); }
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 6px;
padding: 1rem;
}
.row {
display: flex;
padding: 0.3rem 0;
border-bottom: 1px solid var(--border);
font-size: 0.85rem;
}
.row:last-child { border-bottom: none; }
.label {
color: var(--text-dim);
min-width: 140px;
flex-shrink: 0;
}
.value {
color: var(--text);
word-break: break-all;
}
.value.green { color: var(--green); }
.value.amber { color: var(--amber); }
.value.red { color: var(--red); }
.records {
font-size: 0.85rem;
}
.record-group {
margin-bottom: 0.75rem;
}
.record-type {
color: var(--accent);
font-weight: 600;
font-size: 0.8rem;
margin-bottom: 0.25rem;
}
.record-value {
color: var(--text);
padding-left: 1rem;
font-size: 0.8rem;
}
.error-msg {
color: var(--red);
font-size: 0.85rem;
padding: 0.5rem;
}
.placeholder {
color: var(--text-dim);
font-style: italic;
font-size: 0.85rem;
padding: 1rem;
text-align: center;
}
.san-list {
display: flex;
flex-wrap: wrap;
gap: 0.3rem;
}
.san-tag {
background: #1a1a2a;
color: var(--accent);
padding: 0.1rem 0.5rem;
border-radius: 3px;
font-size: 0.75rem;
}
.status-list {
font-size: 0.75rem;
color: var(--text-dim);
}
.loading-spinner {
display: inline-block;
width: 12px;
height: 12px;
border: 2px solid var(--border);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
@media (max-width: 600px) {
.container { padding: 2rem 1.25rem; }
.row { flex-direction: column; }
.label { min-width: unset; margin-bottom: 0.1rem; }
.input-row { flex-direction: column; }
}
</style>
</head>
<body>
<div class="container">
<h1>Domain Report</h1>
<p class="subtitle">Complete domain investigation: DNS, WHOIS, TLS, HTTP probe</p>
<div class="input-row">
<input type="text" id="domain" placeholder="example.com" autofocus>
<button id="lookup" onclick="investigate()">Investigate</button>
</div>
<div id="results" style="display: none;">
<div class="section" id="probe-section">
<h2>HTTP Probe <span id="probe-badge" class="badge badge-loading"><span class="loading-spinner"></span></span></h2>
<div class="card" id="probe-card"><div class="placeholder">Loading...</div></div>
</div>
<div class="section" id="tls-section">
<h2>TLS Certificate <span id="tls-badge" class="badge badge-loading"><span class="loading-spinner"></span></span></h2>
<div class="card" id="tls-card"><div class="placeholder">Loading...</div></div>
</div>
<div class="section" id="dns-section">
<h2>DNS Records <span id="dns-badge" class="badge badge-loading"><span class="loading-spinner"></span></span></h2>
<div class="card" id="dns-card"><div class="placeholder">Loading...</div></div>
</div>
<div class="section" id="whois-section">
<h2>WHOIS <span id="whois-badge" class="badge badge-loading"><span class="loading-spinner"></span></span></h2>
<div class="card" id="whois-card"><div class="placeholder">Loading...</div></div>
</div>
<div class="section" id="geo-section">
<h2>Server Location <span id="geo-badge" class="badge badge-loading"><span class="loading-spinner"></span></span></h2>
<div class="card" id="geo-card"><div class="placeholder">Waiting for DNS...</div></div>
</div>
</div>
</div>
<script>
const API = 'https://api.fridayops.xyz';
const input = document.getElementById('domain');
const btn = document.getElementById('lookup');
input.addEventListener('keydown', e => {
if (e.key === 'Enter') investigate();
});
function investigate() {
let domain = input.value.trim();
if (!domain) return;
// Strip protocol and path
domain = domain.replace(/^https?:\/\//, '').split('/')[0].split(':')[0];
input.value = domain;
document.getElementById('results').style.display = 'block';
btn.disabled = true;
btn.textContent = 'Loading...';
// Reset all badges
['probe', 'tls', 'dns', 'whois', 'geo'].forEach(s => {
document.getElementById(s + '-badge').className = 'badge badge-loading';
document.getElementById(s + '-badge').innerHTML = '<span class="loading-spinner"></span>';
document.getElementById(s + '-card').innerHTML = '<div class="placeholder">Loading...</div>';
});
document.getElementById('geo-card').innerHTML = '<div class="placeholder">Waiting for DNS...</div>';
// Fire all requests in parallel
Promise.allSettled([
fetchProbe(domain),
fetchTLS(domain),
fetchDNS(domain).then(ip => { if (ip) fetchGeoIP(ip); }),
fetchWHOIS(domain),
]).then(() => {
btn.disabled = false;
btn.textContent = 'Investigate';
});
}
function setBadge(id, type, text) {
const el = document.getElementById(id);
el.className = 'badge badge-' + type;
el.textContent = text;
}
function row(label, value, cls) {
return `<div class="row"><span class="label">${label}</span><span class="value${cls ? ' ' + cls : ''}">${value}</span></div>`;
}
async function fetchProbe(domain) {
try {
const r = await fetch(`${API}/probe?url=https://${domain}`);
const d = await r.json();
if (d.error) {
setBadge('probe-badge', 'err', 'error');
document.getElementById('probe-card').innerHTML = `<div class="error-msg">${d.error}</div>`;
return;
}
const statusCls = d.status < 300 ? 'green' : d.status < 400 ? 'amber' : 'red';
setBadge('probe-badge', d.status < 400 ? 'ok' : 'err', d.status);
let html = row('Status', d.status, statusCls);
html += row('Response Time', d.time_ms + 'ms');
html += row('Final URL', d.final_url);
if (d.redirects && d.redirects.length > 0) {
html += row('Redirects', d.redirects.length + ' hop(s)');
}
// Key headers
const h = d.headers || {};
if (h['Server'] || h['server']) html += row('Server', h['Server'] || h['server']);
if (h['Content-Type'] || h['content-type']) html += row('Content-Type', h['Content-Type'] || h['content-type']);
if (h['X-Powered-By'] || h['x-powered-by']) html += row('Powered By', h['X-Powered-By'] || h['x-powered-by']);
document.getElementById('probe-card').innerHTML = html;
} catch (e) {
setBadge('probe-badge', 'err', 'error');
document.getElementById('probe-card').innerHTML = `<div class="error-msg">${e.message}</div>`;
}
}
async function fetchTLS(domain) {
try {
const r = await fetch(`${API}/tls/${domain}`);
const d = await r.json();
if (d.error) {
setBadge('tls-badge', 'err', 'error');
document.getElementById('tls-card').innerHTML = `<div class="error-msg">${d.error}</div>`;
return;
}
const t = d.tls;
const days = t.days_until_expiry;
const daysCls = days > 30 ? 'green' : days > 7 ? 'amber' : 'red';
setBadge('tls-badge', days > 30 ? 'ok' : days > 7 ? 'warn' : 'err',
t.expired ? 'expired' : days + 'd left');
let html = row('Subject', t.subject?.commonName || '—');
html += row('Issuer', (t.issuer?.organizationName || '') + (t.issuer?.commonName ? ' (' + t.issuer.commonName + ')' : ''));
html += row('Protocol', t.protocol);
html += row('Cipher', t.cipher);
html += row('Valid From', t.not_before);
html += row('Valid Until', t.not_after, daysCls);
html += row('Days Left', days, daysCls);
if (t.sans && t.sans.length > 0) {
const sanHtml = t.sans.map(s => `<span class="san-tag">${s.value}</span>`).join('');
html += `<div class="row"><span class="label">SANs</span><span class="value"><div class="san-list">${sanHtml}</div></span></div>`;
}
document.getElementById('tls-card').innerHTML = html;
} catch (e) {
setBadge('tls-badge', 'err', 'error');
document.getElementById('tls-card').innerHTML = `<div class="error-msg">${e.message}</div>`;
}
}
async function fetchDNS(domain) {
try {
const r = await fetch(`${API}/dns/${domain}?type=ALL`);
const d = await r.json();
if (d.error) {
setBadge('dns-badge', 'err', 'error');
document.getElementById('dns-card').innerHTML = `<div class="error-msg">${d.error}</div>`;
return;
}
const records = d.records || {};
const types = Object.keys(records);
setBadge('dns-badge', 'ok', types.length + ' types');
let html = '<div class="records">';
for (const type of types) {
html += `<div class="record-group"><div class="record-type">${type}</div>`;
for (const val of records[type]) {
html += `<div class="record-value">${val}</div>`;
}
html += '</div>';
}
html += '</div>';
document.getElementById('dns-card').innerHTML = html;
// Return first A record for GeoIP lookup
if (records['A'] && records['A'].length > 0) return records['A'][0];
} catch (e) {
setBadge('dns-badge', 'err', 'error');
document.getElementById('dns-card').innerHTML = `<div class="error-msg">${e.message}</div>`;
}
}
async function fetchGeoIP(ip) {
try {
const r = await fetch(`${API}/geoip/${ip}`);
const d = await r.json();
if (d.error) {
setBadge('geo-badge', 'err', 'error');
document.getElementById('geo-card').innerHTML = `<div class="error-msg">${d.error}</div>`;
return;
}
setBadge('geo-badge', 'ok', d.country_code || 'found');
let html = row('IP', ip);
if (d.country) html += row('Country', d.country + (d.country_code ? ' (' + d.country_code + ')' : ''));
if (d.region) html += row('Region', d.region);
if (d.city) html += row('City', d.city);
if (d.isp) html += row('ISP', d.isp);
if (d.org) html += row('Org', d.org);
if (d.as) html += row('AS', d.as);
if (d.lat && d.lon) html += row('Coordinates', d.lat + ', ' + d.lon);
if (d.timezone) html += row('Timezone', d.timezone);
document.getElementById('geo-card').innerHTML = html;
} catch (e) {
setBadge('geo-badge', 'err', 'error');
document.getElementById('geo-card').innerHTML = `<div class="error-msg">${e.message}</div>`;
}
}
async function fetchWHOIS(domain) {
try {
const r = await fetch(`${API}/whois/${domain}`);
const d = await r.json();
if (d.error) {
setBadge('whois-badge', 'err', 'error');
document.getElementById('whois-card').innerHTML = `<div class="error-msg">${d.error}</div>`;
return;
}
setBadge('whois-badge', 'ok', 'found');
let html = '';
if (d.domain) html += row('Domain', Array.isArray(d.domain) ? d.domain[0] : d.domain);
if (d.registrar) html += row('Registrar', d.registrar);
if (d.org) html += row('Organization', d.org);
if (d.creation_date) {
const cd = Array.isArray(d.creation_date) ? d.creation_date[0] : d.creation_date;
html += row('Created', cd.split('T')[0]);
}
if (d.expiration_date) {
const ed = Array.isArray(d.expiration_date) ? d.expiration_date[0] : d.expiration_date;
html += row('Expires', ed.split('T')[0]);
}
if (d.updated_date) {
const ud = Array.isArray(d.updated_date) ? d.updated_date[0] : d.updated_date;
html += row('Updated', ud.split('T')[0]);
}
if (d.name_servers) {
const ns = Array.isArray(d.name_servers) ? d.name_servers.join(', ') : d.name_servers;
html += row('Nameservers', ns);
}
if (d.status) {
const statuses = Array.isArray(d.status) ? d.status : [d.status];
const short = statuses.map(s => s.split(' ')[0]).join(', ');
html += row('Status', `<span class="status-list">${short}</span>`);
}
if (d.country) html += row('Country', d.country);
document.getElementById('whois-card').innerHTML = html;
} catch (e) {
setBadge('whois-badge', 'err', 'error');
document.getElementById('whois-card').innerHTML = `<div class="error-msg">${e.message}</div>`;
}
}
// Auto-investigate if hash has a domain
if (location.hash.length > 1) {
input.value = location.hash.substring(1);
investigate();
}
</script>
<script src="/nav.js"></script>
</body>
</html>