CLI option to also show closed ports #736
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the new CLI option
--closed
, which enables the option to also show ports which are closed.From a security perspective, it is very useful information to see whether we got any response at all for a given port, even when the response is a RST (conn-refused).
It can indicate that our request was denied (or specifically blocked by a firewall).
Currently this behavior is behind the
--closed
CLI flag and not enabled by default.Nmap, for example, shows closed ports by default.
Regarding the output of the
--closed
option, it mimics the output for open ports, but instead ofOpen
it showsClosed
right before the IP Address.If the
-g
(grepable) option is set, first all open ports are printed for each IPs, then the text closed ports: is printed and the same output is repeated for all closed ports.Here is an example:
And with the -g option: