Front | Info | Lists | Newsfeeds | Study Guide | What is BSD?
Advertisement: The OpenBSD PF Packet Filter Book: PF for NetBSD, FreeBSD, DragonFly and OpenBSD

BSD Links
·New Links
·User Groups

This is the BSDA Study Guide Book written via a wiki collaboration. This is a work in progress. You may contribute to or discuss this specific page at

Determine which TCP or UDP ports are open on a system


Be able to use the utilities found on BSD systems as well as third-party programs to determine which ports are open on a system and which ports are being seen through a firewall.


netstat: show network status

services: service name database

fstat: identify active files

sockstat: list open sockets

nmap: network exploration tool and security scanner

lsof: list open files

Determine which ports are open on a system:


netstat -an
sockstat -cl

Remotely: nmap hostname or IP

Using sockstat:

sockstat -cl


Practice Exercises

More information

netstat(1), services(5) and fstat(1); sockstat(1) and third-party nmap and lsof

Front | Information | Lists | Newsfeeds