Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

  • Print
  • + Share This

Using netstat to list ports

Your system probably has many ports open and active right now. The netstat utility can be used to see a current list of all listening ports and active connections.

To use the netstat utility on a computer running Windows 95/98/NT/2000, open a DOS window. If you just type in the command, the results will scroll right off the screen. A simple solution is to port the results into a text file that can then be viewed with a text editor. Enter the command netstat -a > netstat.txt.

Then use an editor like Notepad or simply use the command edit netstat.txt to view the results.

Look at the ports that are shown to be "listening." These are ports that a server on your system is "listening" to for a connection from another computer. Commonly you might see one or more ports in the 137-139 range listening. These are the ports used on Windows NetBIOS networks for file sharing.

On a Linux system, open a terminal window and enter the command
netstat -a | less.

You'll see the range of ports that are either listening or have active connections.

After looking at the results of netstat, you'll get a better idea of what is happening on your system. Just because you see a port is open, however, does not mean that your system is vulnerable to an attack. To find out, you need to take further steps.

  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.