It looks like you're new here. If you want to get involved, click one of these buttons!
<?php
error_reporting(0);
print \"\nPort Scanner\n\n\";
if($argc==1)
{
print \"Usage: ps [HOST] [PORTS] options\n\";
print \"If you want to start a deep scan write D after the number of ports! To start a fast scan write F!\n\";
exit;
}
$ip = \"\";
$ports = \"\";
$method = \"\";
while(list($nr,$val)=each($argv))
{
if($nr>0)
{
$val = strtolower($val);
if(strpos($val,'.')>-1)$ip = $val;
else if(is_numeric($val))$ports = $val;
else if($val == 'f' || $val== 'd')$method=$val;
}
}
if($ip == \"\")
{
print \"Where is the host oeo?\n\";
exit;
}
if($ports == \"\")
{
print \"Ports; Nah!\n\";
exit;
}
if($method == \"\")
{
print \"Deep or Fast Scan?\n\";
exit;
}
print \"HOST: $ip\n\";
print \"Number of ports to scan: $ports\n\";
if ($method == 'd') { print \"Scan: Deep\n\"; }
if ($method == 'f') { print \"Scan: Fast\n\"; }
print \"Please Wait...\n\n\";
for($i=0;$i<=$ports;$i++)
{
if ($method == 'd') {
$timeout = 1;
$fp=fsockopen($ip,$i,$e,$s,$timeout);
if($fp) { print \"Open Port: $i\n\"; fclose($fp); }
} elseif ($method == 'f') {
$timeout = 0.1;
$fp=fsockopen($ip,$i,$e,$s,$timeout);
if($fp) { print \"Open Port: $i\n\"; fclose($fp); }
}
}
print \"\nFinished!\";
?>