Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 31,099 times

Contents

Downloads

Related Categories

PHP Port Scanner - Displaying the results

gringod

Displaying the results

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.

I was born. I lived. I got bored.... I found computers. I live again!!!

Comments

  • Get errors running it on my local server

    Posted by adjamlotfi on 05 Jan 2004

    HI

    I unzipped the script and run it, but I got errors.

    and it's not so fast as indicated ???!!!

    ------------


    Warning: Call-time pass-by-reference has been deprecated - argument passed by...