feat: add soft scan mode (slow ICMP) to avoid switch/AP rate-limiting
Reduces ICMP concurrency from 100 to 10 workers when soft_scan=true, spreading out probes to avoid rate-limiting on managed switches and APs. The option is hidden in the UI when TCP check is active (redundant). Update README (en/fr/es), docs/backend.md with the new scan modes table and a troubleshooting entry for ICMP rate-limiting. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,7 @@ class ScanRequest(BaseModel):
|
||||
dns_server: str = ""
|
||||
targets: list[ScanTarget]
|
||||
tcp_check: bool = False
|
||||
soft_scan: bool = False
|
||||
|
||||
@field_validator("dns_server")
|
||||
@classmethod
|
||||
@@ -189,7 +190,11 @@ def scan(req: ScanRequest):
|
||||
t0 = time.time()
|
||||
results: list[DiscoveredHost] = []
|
||||
|
||||
with ThreadPoolExecutor(max_workers=100) as pool:
|
||||
# Soft scan reduces ICMP concurrency to avoid rate-limiting on switches/APs.
|
||||
# Has no effect in tcp_check mode (TCP probes are not rate-limited the same way).
|
||||
workers = 10 if (req.soft_scan and not req.tcp_check) else 100
|
||||
|
||||
with ThreadPoolExecutor(max_workers=workers) as pool:
|
||||
futures = [pool.submit(_scan_one, *args, tcp_check=req.tcp_check) for args in tasks]
|
||||
for f in as_completed(futures):
|
||||
host = f.result()
|
||||
|
||||
Reference in New Issue
Block a user