Hi all,
I’d like to share this with all of you. Because of my job I had the necessity to know which port where used on a remote server that hadn’t nmap installed on it, so what I did was:
sudo lsof -nP -i | grep LISTEN
Here is the explanation:
lsof – list of open files
-nP the n option inhibits the conversion of network numbers to host names to run faster, while the P option inhibits the conversion of port numbers to port names for network files. Piping the result with grep LISTEN you get a list of all the active ports
Enjoy!