Persist dashboard projects data and tighten nmap host filter

This commit is contained in:
2025-12-29 10:16:17 -05:00
parent af31caeacf
commit e459266e9c
2 changed files with 7 additions and 6 deletions

View File

@@ -11,6 +11,8 @@ services:
- HACKGPT_API_URL=http://strikepackage-hackgpt-api:8001 - HACKGPT_API_URL=http://strikepackage-hackgpt-api:8001
- LLM_ROUTER_URL=http://strikepackage-llm-router:8000 - LLM_ROUTER_URL=http://strikepackage-llm-router:8000
- KALI_EXECUTOR_URL=http://strikepackage-kali-executor:8002 - KALI_EXECUTOR_URL=http://strikepackage-kali-executor:8002
volumes:
- ./data/dashboard:/app/data
depends_on: depends_on:
- hackgpt-api - hackgpt-api
- llm-router - llm-router

View File

@@ -294,11 +294,10 @@ def parse_nmap_xml(xml_output: str) -> List[Dict[str, Any]]:
if not host["os_type"] and host["ports"]: if not host["os_type"] and host["ports"]:
host["os_type"] = infer_os_from_ports(host["ports"]) host["os_type"] = infer_os_from_ports(host["ports"])
# Only include hosts that have either: # Only include hosts with at least one OPEN port
# 1. At least one open port (proves real service) # This prevents false positives from proxy ARP responses
# 2. A valid MAC address (proves real local device) # where routers respond for all IPs even if device is offline
# This filters out false positives from router proxy ARP if host["ip"] and host["ports"]:
if host["ip"] and (host["ports"] or host["mac"]):
hosts.append(host) hosts.append(host)
except ET.ParseError as e: except ET.ParseError as e:
@@ -311,7 +310,7 @@ def parse_nmap_text(output: str) -> List[Dict[str, Any]]:
"""Parse nmap text output as fallback. """Parse nmap text output as fallback.
Only returns hosts that have at least one OPEN port. Only returns hosts that have at least one OPEN port.
Hosts that respond to ping/ARP but have no open ports are filtered out. Filters out false positives from router proxy ARP (where all IPs appear "up").
""" """
hosts = [] hosts = []
current_host = None current_host = None