I'm looking for a command-line utility that allows me to check what service (eg: http/ftp/ssh) is running on a specific port of a remote machine.
An example of how I imagine a program like this would operate:
kess@KG-PC:~$ portcheck google.com:80
Port 80 of google.com is running a(n) "http" server
The simplest way to do such recognition is by establish connection to this port and grab the banner. Banner (usually) can tell you if this is for example Apache httpd, openssh and so on. The list of banners can be quite big. Also you can try some commands like GET / HTTP/1
to check if the service answer to them. For plain text command telnet
can be enough. For encrypted (SSL/TLS) you may need to use openssl s_client
.
AFAIK nmap
can do such things so you can download the source and check how is done there.
If you want to use just a tool you can test:
nmap -A google.com -p 80
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments