()
| 13152 | out.innerHTML = '<p class="text-sm text-red-400">Failed: ' + escapeHtml(e.message) + '</p>'; |
| 13153 | } finally { |
| 13154 | _ndBusy(btn, false); |
| 13155 | } |
| 13156 | } |
| 13157 | |
| 13158 | // ---- MAC Watch card (spoofing + randomization + tracking, detection-only) -- |
| 13159 | const _MACWATCH_VERDICT_STYLE = { |
| 13160 | clean: ['bg-green-950/40 border-green-900 text-green-400', '✓ No MAC spoofing or rotation detected'], |
| 13161 | randomization: ['bg-sky-950/40 border-sky-900 text-sky-300', 'ℹ Privacy-randomized MACs present (no spoofing)'], |
| 13162 | fhrp: ['bg-sky-950/40 border-sky-900 text-sky-300', 'ℹ FHRP (HSRP/VRRP/GLBP) redundancy virtual MAC present (expected)'], |
| 13163 | suspicious: ['bg-amber-950/50 border-amber-800 text-amber-300', '⚠ Device rotating randomized MACs — being tracked'], |
| 13164 | spoofed: ['bg-red-950/60 border-red-800 text-red-300', '🛑 MAC spoofing / cloning detected'], |
| 13165 | unknown: ['bg-slate-800 border-slate-700 text-slate-400', '— Could not determine'], |
| 13166 | }; |
| 13167 | // Fill the MAC Watch interface selector (Auto + each real NIC, WiFi/LAN |
| 13168 | // labelled) so a sweep can target a chosen segment. Called on card render and |
| 13169 | // before the first scan; keeps the current selection if already populated. |
| 13170 | function _macWatchFillIfaces() { |
| 13171 | const sel = document.getElementById('macwatch-iface'); |
| 13172 | if (!sel || sel.dataset.filled === '1') return Promise.resolve(); |
| 13173 | return fetchAPI('/api/net/interfaces').then(x => { |
| 13174 | (x.interfaces || []).forEach(i => { |
| 13175 | const o = document.createElement('option'); |
| 13176 | o.value = i.name; |
| 13177 | const tag = i.type === 'wifi' ? ' (WiFi)' : i.type === 'ethernet' ? ' (LAN)' : (i.type ? ' (' + i.type + ')' : ''); |
| 13178 | o.textContent = i.name + tag; |
| 13179 | sel.appendChild(o); |
nothing calls this directly
no test coverage detected