🐞 fix: Port scanning fixes

This commit is contained in:
Keith Solomon
2026-03-08 19:39:11 -05:00
parent 5dae17fb73
commit 7c5cbcbe7c
4 changed files with 11 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ from .config import (
ENABLE_DOCKER_INSIGHTS,
ENABLE_OS_DETECTION,
PORT_PROBE_TIMEOUT_SECONDS,
SCAN_PORT_SPEC,
SCAN_TOP_PORTS,
)
@@ -270,8 +271,6 @@ def scan_host(ip: str, seed_host: dict[str, Any] | None = None) -> HostResult:
"--open",
"-sV",
"--version-light",
"--top-ports",
str(max(SCAN_TOP_PORTS, 1)),
"-T4",
"--max-retries",
"1",
@@ -279,6 +278,10 @@ def scan_host(ip: str, seed_host: dict[str, Any] | None = None) -> HostResult:
"45s",
ip,
]
if SCAN_PORT_SPEC:
base_args[5:5] = ["-p", SCAN_PORT_SPEC]
else:
base_args[5:5] = ["--top-ports", str(max(SCAN_TOP_PORTS, 1))]
result: HostResult | None = None
if ENABLE_OS_DETECTION: