Jump to content

Port Scan !


d.shankar

Recommended Posts

I have this port scanner code in PHP.

It is ultimately dead slow ... Is it how it works ??

Cant it be remodified ?

 

<?php
$host = "www.google.com";
$start = 0;
$end = 65535;

for($current = $start; $current <= $end; $current++)
{
$service = getservbyport($current, "tcp");

$result = @fsockopen($host, $current);


if($result)
	{
	echo $current." Port is <font color=\"green\"><b>OPEN</b></font><br>";
	flush();
	}
	else
		{
		echo $current." Port is <font color=\"red\"><b>CLOSED</b></font><br>";
		flush();
		}
	}

?>

Link to comment
https://forums.phpfreaks.com/topic/68841-port-scan/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.