// SPDX-License-Identifier: AGPL-3.0-or-later import React from 'react'; import { Clock, Crosshair, FileKey, Fingerprint, Lock, Shield, Wifi, } from '../../../icons'; export const fpTypeLabel: Record = { ja3: 'TLS FINGERPRINT', ja4l: 'LATENCY (JA4L)', ja4h: 'JA4H (HTTP)', ja4_quic: 'JA4-QUIC', tls_resumption: 'SESSION RESUMPTION', tls_certificate: 'CERTIFICATE', tls_certificate_active: 'CERTIFICATE (ACTIVE PROBE)', tls_certificate_passive: 'CERTIFICATE', http_useragent: 'HTTP USER-AGENT', http_quirks: 'HTTP HEADER QUIRKS', http2_settings: 'HTTP/2 SETTINGS', http3_settings: 'HTTP/3 SETTINGS', spoofed_source: 'SPOOFED SOURCE IP', vnc_client_version: 'VNC CLIENT', jarm: 'JARM', hassh_server: 'HASSH SERVER', tcpfp: 'TCP/IP STACK', icmp_error: 'ICMP ERROR LEAK', icmp6_error: 'ICMPv6 ERROR LEAK', }; export const fpTypeIcon: Record = { ja3: , ja4l: , ja4h: , ja4_quic: , tls_resumption: , tls_certificate: , tls_certificate_active: , tls_certificate_passive: , http_useragent: , http_quirks: , http2_settings: , http3_settings: , spoofed_source: , vnc_client_version: , jarm: , hassh_server: , tcpfp: , icmp_error: , icmp6_error: , }; export const UA_CATEGORY_COLOR: Record = { scanner: 'var(--alert, #ff4d4d)', nonstandard: 'var(--warn, #e0a040)', empty: 'var(--warn, #e0a040)', bot: 'var(--violet)', cli: 'var(--matrix)', library: 'var(--matrix)', browser: 'var(--accent-color)', }; export const UA_SIGNAL_COLOR: Record = { injection_like: 'var(--alert, #ff4d4d)', nonprintable: 'var(--alert, #ff4d4d)', suspicious_long: 'var(--warn, #e0a040)', suspicious_short: 'var(--warn, #e0a040)', }; /** Bounty payloads can be either a parsed object or a raw JSON string * depending on producer; normalize before handing to the renderers. */ export function getPayload(bounty: unknown): Record { const b = bounty as { payload?: unknown } | null | undefined; if (b?.payload && typeof b.payload === 'object') { return b.payload as Record; } if (b?.payload && typeof b.payload === 'string') { try { return JSON.parse(b.payload) as Record; } catch { return (bounty ?? {}) as Record; } } return (bounty ?? {}) as Record; } // Random ISN/IP-ID is the modern default; non-random patterns are // fingerprinting gold (legacy stacks, custom raw-socket tools). export const seqClassColor = (cls: string): string | undefined => { switch (cls) { case 'random': return undefined; // neutral, expected case 'incremental': return '#e5c07b'; // amber — uncommon case 'zero': case 'constant': return '#98c379'; // green — strong signal default: return undefined; } }; export const HashRow: React.FC<{ label: string; value?: string | null }> = ({ label, value }) => { if (!value) return null; return (
{label} {value}
); };