🐞 fix: Port scanning fixes
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user