PDA

View Full Version : [PHP] Port Scanner.



Frederick
04-21-2008, 04:06 PM
This script was created by myself a while back, its good for finding open ports on websites... to find what applications are running.

For example:

2082 = Cpanel


<?

/**
************************************************** ***
*****************|PHP Port Scanner|******************
********|Created by KOUM of www.TheDefaced.org|******
************************************************** ***
*****************Thanks to X2Fusion******************
************************************************** ***
*/


echo "<HTML>";
echo "<TITLE>PHP Port Scanner by KOUM</TITLE>";
echo "<BODY>";
echo "<body BGCOLOR=Silver>";
echo "<center><h1><u>PHP Port Scanner - Created by KOUM</u></h1></center>";
echo "<form action=" . $_SERVER['PHP_SELF'] . " method="post">";
echo "<B>Enter IP or URL:</b><br>";
echo '<input type="text" name="host" /><br><br>';
echo '<b>Enter Starting Port:<input type="text" name="starting" value="1" />Enter Finishing Port:</b> <input type="text" name="finishing" value="500" />' . '<br><br></b>';
echo '<input name="submit" type="submit" id="submit" value="Scan!" />';
echo '<input name="reset" type="reset" id="reset" value="Reset" />';
echo '</form>';
echo '<br><br><br>';
echo '<center>&copy; Koum (TheDefaced.org)</center>';
echo '</body>';
echo '</HTML>'
?>

<?

$server = $_POST["host"];
for($i=$_POST["starting"];$i<=$_POST["finishing"];$i++) {
$scan = @fsockopen($server,$i);
if($scan)
{
//Echo if found open!
echo "<br>port <b>" . $i . "</b> OPEN ON " . "<b>" . $server . "<br></b>";
}
else
{
//If not do nothing!
echo "";
}
flush();
}
?>