I'm pretty new with networks scanning and test tools (nmap and netcat). I want to know how to differentiate :
How to differentiate these two situations on results of nmap and/or nc commands ?
Thanks
If the service is not listening you'll get a connection refused message.
Example
# no service listening
$ nc -vz 127.0.0.1 22
Ncat: Version 7.80 ( https://nmap.org/ncat )
Ncat: Connection refused.
# service listening
$ nc -vz 127.0.0.53 53
Ncat: Version 7.80 ( https://nmap.org/ncat )
Ncat: Connected to 127.0.0.53:53.
Ncat: 0 bytes sent, 0 bytes received in 0.03 seconds.