Net_Portscan::checkPortRange() -- check for available services
Описание
This function checks if there are services available at the
specified ports on the specified machine.
Параметр
string $host - address of the host
to check
string $minPort - lowest port to test
to check
string $maxPort - highest port to test
to check
string $timeout -
time in seconds to wait for every response from host
Возвращаемое значение
array - An associative array containing the
scanning results for each port.
Заметка
Эта функция может быть вызвана статически.
Пример
Пример 34-1. Using checkPortRange require_once "Net_Portscan/Portscan.php";
echo "Scanning localhost ports 70-90\n";
$result = Net_Portscan::checkPortRange("localhost", 70, 90);
foreach ($result as $port => $element) {
if ($element == NET_PORTSCAN_SERVICE_FOUND) {
echo "A service has been found on port " . $port . ".\n";
} else {
echo "No service has been found on port " . $port . ".\n";
}
} |
|
HIVE: All information for read only. Please respect copyright! |