Tiny Deathstars of Foulness

It’s not nmap, but then it’s not meant to be.  Network Utility has a port scanner – it’s built in and really easy to use.  Since Network Utility is distributed with every copy of Mac OS X it stands to reason that every copy of Mac OS X has the ability to scan a port without using a GUI tool.  Enter one of the best named tools in Mac OS X, stroke.  Stroke is the command line back-end to the Port Scan tab of Network Utility.  To use stroke, you will need to cd into the Network Utility application bundle and then cd into Contents and then Resources. Once you are in the /Applications/Utilities/Network, you will need to provide stroke with an IP address (or name), followed by the first port to scan and then the last (or the same number twice if your range is only one IP address.  For example, if you want to port scan port 80 on your own system you could use the following:
./stroke 80 80
But you shouldn’t just stroke yourself (sorry, couldn’t help it).  You should also stroke others (Clarence Carter be damned!).  So if you want to port scan for port 80 the following would achieve such a lofty goal:
./stroke 80 80
Because the name has to resolve, you’re actually able to check whether a DNS error occurs and whether you can communicate over port 80 to the host in one command.  If you want to make a copy of stroke into a directory and then add it to your environment variable’s PATH you can then use it without needing to change your working directory.

May 12th, 2009

Posted In: Mac OS X, Mac Security

Tags: , ,

  • Roisenberg

    all ports open in host, no password

  • Kjell

    Nice find! Exactly what i was looking for.

    I went on and simply added a symbolic link inside /usr/local/bin so i don’t have to go into the folder all the time.

    ln -s /Applications/Utilities/Network /usr/local/bin/stroke

    One could also just add an alias inside his ~/.profile

    alias stroke="/Applications/Utilities/Network"


  • As you mention in, I found it in `/System/Library/CoreServices/Applications/Network` on my Mac, (macOS 10.12 (16A320))