Nmap can also be asked to check the service version when doing port scanning. This information is very useful when you perform the vulnerability-identification process later on.
To use this feature, give Nmap the -sV option.
The following is an example for this feature's usage. We want to find the software version used on port 22:
nmap -sV 172.16.43.156 -p 22
The following is the result of this command:
From the preceding information, we know that on port 22 there is an SSH service using the OpenSSH software version 4.7p1, and the SSH protocol is 2.0.