Skip to content

Check open ports - server

FreeBSD

sockstat

- -4 = IPv4 sockets
- -6 = IPv6 sockets
- -c = only connected sockets
- -l = listening sockets
sockstat -4 -l

Linux

lsof

lsof -i:5060
lsof -P -n -iTCP -sTCP:LISTEN,ESTABLISHED

netstat

TCP, UDP

netstat -plntu

ss

ssh -pltn

Windows

# Get PID
$ netstat -aon  
# and looking in tasklist
#
# With process name, but on the other line
$ netstat -abn