PHP/Network/Port — различия между версиями

Материал из Web эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Версия 13:37, 26 мая 2010

Port scan

   <source lang="html4strict">

<?php

  // Give the script enough time to complete the task
  ini_set("max_execution_time",120);
  $rangeStart = 0;
  $rangeStop = 1024;
  $target = "www.wbex.ru";
  $range =range($rangeStart, $rangeStop);
echo "

Scan results for $target

";
  foreach ($range as $port) {
     $result = @fsockopen($target, $port,$errno,$errstr,1);
     if ($result) 
echo "

Socket open at port $port

";
  }

?>

      </source>