The netstat (network statistics) command is included in most modern operating systems and it shows the active connections on a machine. You would generally use it when you want to find out what type of services are running on a workstation or what connections are open on that machine.
In a Windows environment, the following related commands are commonly used:
- netstat –a: lists all active connections (see the screenshot below)
- netstat –b: lists the applications (executables) that use the active connections
- netstat –n: lists the connections without doing a DNS resolution
Figure 23.20 – Windows netstat -a Command Output
Some of the most important fields in the output above include the following:
- Protocol
- Local address
- Remote address
- Connection state (listening, established, syn_sent)
Figure 23.21 below shows the output for the netstat command in a Linux environment:
Figure 23.21 – Linux netstat Command Output

