Skip to content

fix(main): print the no-open-ports hint once, only when nothing was found - #960

Open
demrom wants to merge 1 commit into
bee-san:masterfrom
demrom:quiet-no-open-ports-per-host
Open

demrom wants to merge 1 commit into
bee-san:masterfrom
demrom:quiet-no-open-ports-per-host

Conversation

@demrom

@demrom demrom commented Oct 20, 2026

Copy link
Copy Markdown

Fixes #795

Sweeping a subnet for a few ports, as in rustscan -a 192.168.178.0/24 -p 443,80, prints the batch-size hint for every host that has none of them open. When one host answers, that is 255 copies of a three-paragraph warning around a single result line.

When any host answers, replies got through at this batch size and timeout, so the other hosts most likely have nothing open on those ports. The hint now prints once, and only when no host answered:

  • one target, nothing found: unchanged, didn't find any open ports for 192.0.2.1
  • several targets, nothing found: one hint, didn't find any open ports on any of the 256 addresses
  • any target with at least one open port, or a closed one under --closed: no hint (so under --closed a single host that refused the connection no longer gets it either)

The check lives in no_open_ports_warning(), so it is unit-tested without scanning. Four tests cover the cases above. Three of them fail with the old per-host loop.

Every step of just test passes (tests, both clippy runs, fmt --check, docs). I also ran each case, including a single host with --closed, on a real LAN and got the output listed above. If you'd rather word the multi-host hint differently, I'll change it here.

…ound

A subnet sweep for one port printed the batch-size hint for every host without that port. When any host answered with an open port, or a closed one under --closed, replies got through at this batch size and timeout, so batch size and timeout are unlikely to be the cause and the hint is skipped. When nothing was found it is printed once for all targets.

Fixes bee-san#795
@demrom
demrom marked this pull request as ready for review October 20, 2026 23:42

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When used with the --port option, lot of noisy output is generated

1 participant