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

A Linux Firewall for Your Home

  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss

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 ThisShare This
  • Your Account

Discussions

Make a New Comment

You must log in in order to post a comment.

Related Resources

Jennifer  BortelWin FREE iPhone Developer Books and Videos- Introducing @InformIT Giveaways
By Jennifer Bortel on February 5, 2010 No Comments

Apples’s recent iPad announcement made our hearts flutter so we couldn’t resist making an announcement of our own!

Today marks the first ever @InformIT Giveaway!

We’ll regularly post a video like this one profiling spectacular prizes we’re giving away—from books and videos to T-shirts and other exciting stuff. Check out the video below to see the giveaways for today, and then scroll down for more prize details and instructions on how to win them!

So Far So Good
By John Traenkenschuh on February 2, 2010 No Comments

So far, Win 7 is making a thoroughbred of what has been a plough mule laptop

Dustin Sullivan"Every OSX developer should have this book on their desk."
By Dustin Sullivan on February 1, 2010 No Comments

That was the sentence Mike Riley ended his recent Dr Dobb's CodeTalk review of Cocoa Programming Developer's Handbook with.

See All Related Blogs

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

Informit Network