The following is an example of the way in which the results of the port scanner can be displayed:
foreach($results as $ip=>$ip_results) { echo gethostbyaddr($ip)."\n<blockquote>\n";
foreach($ip_results as $port=>$port_results) { echo "\t".$port." : ".$port_results['pname']." : "; if ($port_results['status']==1){echo "open";} else {echo "closed";}echo "<br>\n"; } echo "</blockquote>\n\n"; }
This code quite simply loops through the results, printing the host name, followed by an indented report of each scanned port.
Given the structured nature of the returned results, they could just as easily be displayed in a table, sent as an email, or even writen to a log file.
Comments