error_reporting(0); $num = 1; echo "Starting port scan on $argv[1]. SPS - Simple Port Scanner (C) Dalton Conley\n"; while($num != 10000) { // dont want to open any more ports, takes too long $host = $argv[1]; $sock = fsockopen($host, $num, $errno, $errstr, 30); if($sock) { echo "PORT $num IS VALID\n"; } $num = $num + 1; } echo "Scan Ended\n";