Reputation: 13
Can anybody help me with using nmap? I don't quite get it when it comes to find out which port a specific server is running on.
To exemplify my issue, I have to install the apache2 web server on an Ubuntu OS. Then, I have to start its daemon (no problem, I simply ran "service apache2 start", which, I think, really did the job for me). Now, I just have to figure out on which port this service is running. I read about netstat and nmap, but I don't really know which parameters I should use in order to find out the port. So, my question is : Is there any way to find out the port this service is using? If yes, how could I do that?
Furthermore, if I wanna find out which ports are opened (in "established" or "listening" state) on a specific server, how should I proceed to find out?
Thanks very much in advance.
Upvotes: 1
Views: 3483
Reputation: 322
netstat -tlp
does what you ask for. nmap would work (e.g. nmap -n localhost
), but why scanning ports if you just can ask the system?
Upvotes: 1