Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Enable command-line portscanning UNIX
Just found this over at the forums (credit to kennethmac2000 for that). There is no real command for doing portscans in the Terminal, so instead of installing nmap, just use the Network Utility from the command line like this:
 % cd /Applications/Utilities/'Network'
% sudo cp Contents/Resources/stroke /bin/portscan
% rehash
Now you can do portscans from the command line using the following syntax:
portscan [address] [startPort] [endPort]
[Editor's note: I thought we had published something similar before, but I can't seem to locate it...]
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)

Enable command-line portscanning | 2 comments | Create New Account
Click here to return to the 'Enable command-line portscanning' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
just symlink it...
Authored by: mweissen on Apr 15, '02 05:26:56AM

sudo ln -s "/Applications/Utilities/Network" /bin/portscan

[ Reply to This | # ]
Reverse is also true.
Authored by: steviant on Jul 17, '02 12:23:32AM

It's also possible to kludge Network Utility to use nmap to portscan by making a script like this called stroke in place of the featureless portscanner included by default (you can include extra command line parameters in the IP field)...

if [ "$2" = "0" ]; then
/sw/bin/nmap -p 1-$3 $1
/sw/bin/nmap -p $2-$3 $1

This one uses nmap as installed by fink, if you're using a .pkg'd nmap, then you need to point the script at the right place.

don't forget to chmod +x the script afterwards. :)

[ Reply to This | # ]