CLI option to also show closed ports
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 of Open it shows Closed 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:
.----. .-. .-. .----..---. .----. .---. .--. .-. .-.
| {} }| { } |{ {__ {_ _}{ {__ / ___} / {} \ | `| |
| .-. \| {_} |.-._} } | | .-._} }\ }/ /\ \| |\ |
`-' `-'`-----'`----' `-' `----' `---' `-' `-'`-' `-'
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog :
: https://github.com/RustScan/RustScan :
--------------------------------------
TreadStone was here 🚀
[~] The config file is expected to be at "/********/.rustscan.toml"
[~] Automatically increasing ulimit value to 50000.
Closed [10.100.0.1]:22
Open [10.100.0.1]:2222
10.100.0.1 -> [2222]
closed ports:
10.100.0.1 -> [22]
And with the -g option:
10.100.0.1 -> [2222]
closed ports:
10.100.0.1 -> [22]
I have rebased the feature onto master.
@bee-san Can you please also have a look at this PR?
thanks for this! has a merge conflict :(