Changesets · Branches · Tags · Compare
| Changeset | 35361bd0a86f47d12cf20522e2b2cbbf5a859ad78c0d5dfc40e76cdc59371eab |
|---|---|
| Author | Gemini CLI <gemini@example.com> · 2026-05-23 13:14 -04:00 |
| Committer | Gemini CLI <gemini@example.com> · 2026-05-23 13:14 -04:00 |
| Parents | 4aaf9f4870ef |
3 files changed
modified src/app/page.tsx +10 −1
| @@ -99,6 +99,7 @@ | ||
| 99 | 99 | const [mapProjection, setMapProjection] = useState<'globe'|'mercator'>('globe'); |
| 100 | 100 | const [mapStyle, setMapStyle] = useState<'dark'|'satellite'>('dark'); |
| 101 | 101 | const [sweepData, setSweepData] = useState<any>(null); |
| 102 | + const [scanTargets, setScanTargets] = useState<any[]>([]); | |
| 102 | 103 | |
| 103 | 104 | const isMobile = useIsMobile(); |
| 104 | 105 | const startTime = useRef(Date.now()); |
| @@ -594,9 +595,11 @@ | ||
| 594 | 595 | onViewStateChange={setMapView} |
| 595 | 596 | flyToLocation={flyToLocation} |
| 596 | 597 | sweepData={sweepData} |
| 598 | + scanTargets={scanTargets} | |
| 597 | 599 | /> |
| 598 | 600 | </ErrorBoundary> |
| 599 | 601 | |
| 602 | + | |
| 600 | 603 | {/* ── MAP VIEW CONTROLS (3D/2D + SATELLITE TOGGLE) ── */} |
| 601 | 604 | <motion.div |
| 602 | 605 | initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ delay: 3.5 }} |
| @@ -732,7 +735,13 @@ | ||
| 732 | 735 | <div className="flex-1"><SearchBar onLocate={(lat, lng) => setFlyToLocation({ lat, lng, ts: Date.now() })} /></div> |
| 733 | 736 | <div className="relative"><SharePanel mapView={mapView} activeLayers={activeLayers} mouseCoords={mouseCoords} /></div> |
| 734 | 737 | </div> |
| 735 | - <OsintPanel onSweepVisualize={setSweepData} /> | |
| 738 | + <OsintPanel onSweepVisualize={setSweepData} onScanGeolocate={(target, data) => { | |
| 739 | + setScanTargets(prev => { | |
| 740 | + const existing = prev.filter(t => t.id !== target); | |
| 741 | + return [{ id: target, timestamp: Date.now(), ...data }, ...existing].slice(0, 10); | |
| 742 | + }); | |
| 743 | + setFlyToLocation({ lat: data.lat, lng: data.lng, ts: Date.now() }); | |
| 744 | + }} /> | |
| 736 | 745 | <LiveAlerts data={data} onLocate={(lat, lng) => setFlyToLocation({ lat, lng, ts: Date.now() })} onWatchFeed={(url, name) => { setLiveFeedUrl(url); setLiveFeedName(name); }} /> |
| 737 | 746 | </div> |
| 738 | 747 |
modified src/components/OsintPanel.tsx +22 −9
| @@ -12,7 +12,7 @@ | ||
| 12 | 12 | |
| 13 | 13 | const TABS = [ |
| 14 | 14 | { id: 'scanner', label: 'PORT SCAN', icon: Radar, placeholder: 'IP or hostname', color: '#00E5FF' }, |
| 15 | - { id: 'vuln', label: 'VULN SCAN', icon: Bug, placeholder: 'IP or hostname', color: '#FF3D3D' }, | |
| 15 | + { id: 'vuln', label: 'VULN SWEEP', icon: Bug, placeholder: 'IP or hostname', color: '#FF3D3D' }, | |
| 16 | 16 | |
| 17 | 17 | { id: 'dns', label: 'DNS', icon: Server, placeholder: 'Domain name', color: '#448AFF' }, |
| 18 | 18 | { id: 'whois', label: 'WHOIS', icon: FileText, placeholder: 'Domain name', color: '#FFD700' }, |
| @@ -25,9 +25,9 @@ | ||
| 25 | 25 | { id: 'sweep', label: 'IP SWEEP', icon: Crosshair, placeholder: 'Enter IP address (e.g. 8.8.8.8)', color: '#FF3D3D' }, |
| 26 | 26 | ]; |
| 27 | 27 | |
| 28 | -interface OsintPanelProps { isOpen?: boolean; onClose?: () => void; isMobile?: boolean; onSweepVisualize?: (data: any) => void; } | |
| 28 | +interface OsintPanelProps { isOpen?: boolean; onClose?: () => void; isMobile?: boolean; onSweepVisualize?: (data: any) => void; onScanGeolocate?: (target: string, data: any) => void; } | |
| 29 | 29 | |
| 30 | -function OsintPanelInner({ isMobile, onSweepVisualize }: OsintPanelProps) { | |
| 30 | +function OsintPanelInner({ isMobile, onSweepVisualize, onScanGeolocate }: OsintPanelProps) { | |
| 31 | 31 | const [activeTab, setActiveTab] = useState('scanner'); |
| 32 | 32 | const [isFullScreen, setIsFullScreen] = useState(false); |
| 33 | 33 | const [query, setQuery] = useState(''); |
| @@ -72,17 +72,18 @@ | ||
| 72 | 72 | if (!query.trim() || loading) return; |
| 73 | 73 | setLoading(true); setError(''); setResults(null); |
| 74 | 74 | |
| 75 | - // IP Sweep — separate flow | |
| 76 | - if (activeTab === 'sweep') { | |
| 75 | + // IP Sweep / Vuln Scan — separate flow | |
| 76 | + if (activeTab === 'sweep' || activeTab === 'vuln') { | |
| 77 | 77 | setSweepResult(null); |
| 78 | 78 | setSweepProgress({ current: 0, total: Math.pow(2, 32 - sweepCidr) }); |
| 79 | 79 | try { |
| 80 | - const res = await fetch(`/api/osint/sweep?ip=${encodeURIComponent(query)}&cidr=${sweepCidr}`); | |
| 80 | + const cidr = sweepCidr; | |
| 81 | + const res = await fetch(`/api/osint/sweep?ip=${encodeURIComponent(query)}&cidr=${cidr}`); | |
| 81 | 82 | if (!res.ok) { const e = await res.json().catch(() => ({})); throw new Error(e.error || `Sweep failed (${res.status})`); } |
| 82 | 83 | const data = await res.json(); |
| 83 | 84 | setSweepResult(data); |
| 84 | 85 | setSweepProgress(null); |
| 85 | - setHistory(prev => [{ tab: 'sweep', query, time: new Date().toLocaleTimeString() }, ...prev.slice(0, 9)]); | |
| 86 | + setHistory(prev => [{ tab: activeTab, query, time: new Date().toLocaleTimeString() }, ...prev.slice(0, 9)]); | |
| 86 | 87 | } catch (err: any) { |
| 87 | 88 | setError(err.message); |
| 88 | 89 | setSweepProgress(null); |
| @@ -101,7 +102,6 @@ | ||
| 101 | 102 | case 'whois': url = `/api/osint/whois?domain=${encodeURIComponent(query)}`; break; |
| 102 | 103 | case 'threats': url = `/api/osint/threats?query=${encodeURIComponent(query)}`; break; |
| 103 | 104 | case 'scanner': url = `/api/scanner?target=${encodeURIComponent(query)}&type=${scanType}`; break; |
| 104 | - case 'vuln': url = `/api/scanner?target=${encodeURIComponent(query)}&type=vuln`; break; | |
| 105 | 105 | case 'headers': url = `/api/scanner?target=${encodeURIComponent(query)}&type=headers`; break; |
| 106 | 106 | case 'ssl': url = `/api/scanner?target=${encodeURIComponent(query)}&type=ssl`; break; |
| 107 | 107 | case 'subdomains': url = `/api/scanner?target=${encodeURIComponent(query)}&type=subdomains`; break; |
| @@ -112,6 +112,19 @@ | ||
| 112 | 112 | if (res.ok) { |
| 113 | 113 | setResults(data); |
| 114 | 114 | setHistory(prev => [{ tab: activeTab, query, time: new Date().toLocaleTimeString() }, ...prev.slice(0, 9)]); |
| 115 | + | |
| 116 | + // Geolocate the target in the background | |
| 117 | + if (activeTab !== 'sweep' && activeTab !== 'vuln') { | |
| 118 | + fetch(`/api/osint/ip?ip=${encodeURIComponent(query)}`) | |
| 119 | + .then(r => r.json()) | |
| 120 | + .then(locData => { | |
| 121 | + if (locData && locData.geo && locData.geo.lat && locData.geo.lon && onScanGeolocate) { | |
| 122 | + // ip-api returns lat/lon, we pass it up | |
| 123 | + onScanGeolocate(query, { lat: locData.geo.lat, lng: locData.geo.lon, ...locData, type: activeTab }); | |
| 124 | + } | |
| 125 | + }) | |
| 126 | + .catch(() => {}); | |
| 127 | + } | |
| 115 | 128 | } else { |
| 116 | 129 | setError(data.error || 'Lookup failed'); |
| 117 | 130 | } |
| @@ -418,7 +431,7 @@ | ||
| 418 | 431 | <option value="quick">QUICK SCAN</option><option value="deep">DEEP SCAN</option><option value="ports">TOP 1000 PORTS</option> |
| 419 | 432 | </select> |
| 420 | 433 | )} |
| 421 | - {activeTab === 'sweep' && ( | |
| 434 | + {(activeTab === 'sweep' || activeTab === 'vuln') && ( | |
| 422 | 435 | <div className="flex items-center justify-between bg-[var(--bg-primary)]/60 border border-[var(--border-primary)] rounded-lg p-1"> |
| 423 | 436 | <span className="text-[9px] font-mono text-[var(--text-muted)] pl-2">SUBNET MASK:</span> |
| 424 | 437 | <div className="flex items-center gap-0.5"> |
modified src/components/OsirisMap.tsx +49 −3
| @@ -15,6 +15,7 @@ | ||
| 15 | 15 | projection?: 'mercator' | 'globe'; |
| 16 | 16 | mapStyle?: string; |
| 17 | 17 | sweepData?: any; |
| 18 | + scanTargets?: any[]; | |
| 18 | 19 | } |
| 19 | 20 | |
| 20 | 21 | function computeSolarTerminator(): [number, number][] { |
| @@ -39,7 +40,7 @@ | ||
| 39 | 40 | |
| 40 | 41 | const EMPTY_FC = { type: 'FeatureCollection' as const, features: [] }; |
| 41 | 42 | |
| 42 | -function OsirisMap({ data, activeLayers, onEntityClick, onMouseCoords, onRightClick, onViewStateChange, flyToLocation, projection = 'globe', mapStyle = 'dark', sweepData }: OsirisMapProps) { | |
| 43 | +function OsirisMap({ data, activeLayers, onEntityClick, onMouseCoords, onRightClick, onViewStateChange, flyToLocation, projection = 'globe', mapStyle = 'dark', sweepData, scanTargets = [] }: OsirisMapProps) { | |
| 43 | 44 | const containerRef = useRef<HTMLDivElement>(null); |
| 44 | 45 | const mapRef = useRef<maplibregl.Map | null>(null); |
| 45 | 46 | const popupRef = useRef<maplibregl.Popup | null>(null); |
| @@ -108,7 +109,7 @@ | ||
| 108 | 109 | createDot(map, 'dot-cctv', '#39FF14', 10); |
| 109 | 110 | |
| 110 | 111 | // Sources |
| 111 | - const sources = ['flights','military','jets','private-fl','satellites','earthquakes','gdelt','gps-jamming','day-night','cctv','fires','weather','infrastructure','maritime','maritime-choke','maritime-ships','live-news','sigint-news','conflict-zones', 'war-alerts-targets', 'war-alerts-lines', 'balloons', 'radiation', 'ip-sweep-devices', 'ip-sweep-pulse', 'ip-sweep-connections']; | |
| 112 | + const sources = ['flights','military','jets','private-fl','satellites','earthquakes','gdelt','gps-jamming','day-night','cctv','fires','weather','infrastructure','maritime','maritime-choke','maritime-ships','live-news','sigint-news','conflict-zones', 'war-alerts-targets', 'war-alerts-lines', 'balloons', 'radiation', 'ip-sweep-devices', 'ip-sweep-pulse', 'ip-sweep-connections', 'scan-targets']; | |
| 112 | 113 | sources.forEach(s => map.addSource(s, { type: 'geojson', data: EMPTY_FC })); |
| 113 | 114 | |
| 114 | 115 | // ── CONFLICT ZONES — small warning markers (not polygons) ── |
| @@ -354,6 +355,21 @@ | ||
| 354 | 355 | 'text-color': ['get', 'color'], 'text-halo-color': '#000', 'text-halo-width': 1.5, 'text-opacity': 0.9, |
| 355 | 356 | }}); |
| 356 | 357 | |
| 358 | + // ══ SCAN TARGETS — Geolocated individual scans ══ | |
| 359 | + map.addLayer({ id: 'scan-targets-glow', type: 'circle', source: 'scan-targets', paint: { | |
| 360 | + 'circle-radius': ['interpolate',['linear'],['zoom'], 1,12, 5,25, 10,40], | |
| 361 | + 'circle-color': '#FF3D3D', 'circle-opacity': 0.2, 'circle-blur': 1, | |
| 362 | + }}); | |
| 363 | + map.addLayer({ id: 'scan-targets-dots', type: 'circle', source: 'scan-targets', paint: { | |
| 364 | + 'circle-radius': ['interpolate',['linear'],['zoom'], 1,5, 5,8, 10,12], | |
| 365 | + 'circle-color': '#FF3D3D', 'circle-opacity': 0.95, | |
| 366 | + 'circle-stroke-width': 2, 'circle-stroke-color': '#FFFFFF', 'circle-stroke-opacity': 0.8, | |
| 367 | + }}); | |
| 368 | + map.addLayer({ id: 'scan-targets-label', type: 'symbol', source: 'scan-targets', layout: { | |
| 369 | + 'text-field': ['get', 'id'], 'text-size': 11, 'text-font': ['Open Sans Bold'], | |
| 370 | + 'text-offset': [0, 2], 'text-max-width': 14, 'text-allow-overlap': false, | |
| 371 | + }, paint: { 'text-color': '#FF3D3D', 'text-halo-color': '#000', 'text-halo-width': 1.5, 'text-opacity': 0.9 }}); | |
| 372 | + | |
| 357 | 373 | // Flight layers (WebGL symbol — GPU rendered, handles 50K+ smooth) |
| 358 | 374 | const flightLayers = [ |
| 359 | 375 | { id: 'fl-commercial', src: 'flights', icon: 'plane-cyan' }, |
| @@ -566,11 +582,26 @@ | ||
| 566 | 582 | |
| 567 | 583 | |
| 568 | 584 | // ── Generic hover for clickables ── |
| 569 | - ['conflict-icons','cctv-dots','eq-circles','sat-dots','fires-heat','gdelt-dots','weather-dots','infra-dots','maritime-dots','choke-dots','news-dots','sigint-news-dots','balloon-dots','rad-dots','ship-dots','sweep-device-dots'].forEach(layer => { | |
| 585 | + ['conflict-icons','cctv-dots','eq-circles','sat-dots','fires-heat','gdelt-dots','weather-dots','infra-dots','maritime-dots','choke-dots','news-dots','sigint-news-dots','balloon-dots','rad-dots','ship-dots','sweep-device-dots','scan-targets-dots'].forEach(layer => { | |
| 570 | 586 | map.on('mouseenter', layer, () => { map.getCanvas().style.cursor = 'pointer'; }); |
| 571 | 587 | map.on('mouseleave', layer, () => { map.getCanvas().style.cursor = ''; }); |
| 572 | 588 | }); |
| 573 | 589 | |
| 590 | + // ── Scan Targets click ── | |
| 591 | + map.on('click', 'scan-targets-dots', (e: any) => { | |
| 592 | + const p = e.features?.[0]?.properties; | |
| 593 | + if (!p) return; | |
| 594 | + const coords = e.features[0].geometry.coordinates.slice(); | |
| 595 | + popup(coords, `<div style="${pStyle}border:1px solid rgba(255,61,61,0.5);"> | |
| 596 | + <div style="color:#FF3D3D;font-size:12px;font-weight:700;margin-bottom:6px;">🎯 TARGET: ${p.id}</div> | |
| 597 | + <div style="font-size:9px;color:#E8E6E0;margin-bottom:8px;">${p.city || 'Unknown'}, ${p.country || 'Unknown'} — ${p.isp || 'Unknown ISP'}</div> | |
| 598 | + <div style="display:grid;grid-template-columns:1fr 1fr;gap:4px;font-size:9px;"> | |
| 599 | + <div><span style="color:#5C5A54;">TYPE</span><br/><span style="color:#00E5FF;">${(p.type || 'UNKNOWN').toUpperCase()}</span></div> | |
| 600 | + <div><span style="color:#5C5A54;">COORDS</span><br/><span style="color:#E8E6E0;">${coords[1].toFixed(3)}°, ${coords[0].toFixed(3)}°</span></div> | |
| 601 | + </div> | |
| 602 | + </div>`); | |
| 603 | + }); | |
| 604 | + | |
| 574 | 605 | // ── IP Sweep device click ── |
| 575 | 606 | map.on('click', 'sweep-device-dots', (e: any) => { |
| 576 | 607 | const p = e.features?.[0]?.properties; |
| @@ -977,6 +1008,21 @@ | ||
| 977 | 1008 | return () => clearTimeout(timer); |
| 978 | 1009 | }, [mapReady, sweepData, setGeo]); |
| 979 | 1010 | |
| 1011 | + // Scan Targets visualization | |
| 1012 | + useEffect(() => { | |
| 1013 | + if (!mapReady || !mapRef.current || !scanTargets) return; | |
| 1014 | + const map = mapRef.current; | |
| 1015 | + | |
| 1016 | + const features = scanTargets.map(t => ({ | |
| 1017 | + type: 'Feature' as const, | |
| 1018 | + geometry: { type: 'Point' as const, coordinates: [t.lng, t.lat] }, | |
| 1019 | + properties: { ...t } | |
| 1020 | + })); | |
| 1021 | + | |
| 1022 | + const src = map.getSource('scan-targets') as maplibregl.GeoJSONSource; | |
| 1023 | + if (src) src.setData({ type: 'FeatureCollection', features }); | |
| 1024 | + }, [scanTargets, mapReady]); | |
| 1025 | + | |
| 980 | 1026 | // Fly-to |
| 981 | 1027 | useEffect(() => { |
| 982 | 1028 | if (!mapReady || !mapRef.current || !flyToLocation) return; |