Friday, June 06, 2003

A little something for the AWK folks. Assuming you have AWK, xargs, and netcat installed on your Windows box (and why the hell wouldn't you?), this batch file will scan the hostname supplied on the command line for all the ports listed in the services file.

@echo off
awk -F"[ /]+" "/tcp/{print $2}" %systemroot%\system32\drivers\etc\services | xargs nc -vz %1

(Of course if you have all that stuff you probably have nmap or something too)

Comments: