2012-01-29

Port Scanning

If you need to see if your Mac has any software currently listening on a particular port, you can run this at the command-line (in Terminal.app or Path Finder):

/Applications/Utilities/Network\ Utility.app/Contents/Resources/stroke 127.0.0.1 5432 5432

That example is looking for the default port to the Postgres database server. Another example would be Apache Tomcat and other web servers that default to port 8080:

/Applications/Utilities/Network\ Utility.app/Contents/Resources/stroke 127.0.0.1 8080 8080

Why repeat the port number? Because you can scan a range of ports. The first number is the start of a range, the second number is the end of the range.

And besides this command-line approach, you can use the Network Utility app bundled with your Mac in the Utilities folder:
/Applications/Utilities/Network Utility.app

No comments:

Post a Comment