TShopping
標題:
port_scanner.php
[打印本頁]
作者:
woff
時間:
2022-4-4 23:15
標題:
port_scanner.php
<?php
ini_set('max_execution_time', 0);
ini_set('memory_limit', -1);
$host = 'google.com';
$ports = array(21, 25, 80, 81, 110, 143, 443, 587, 2525, 3306);
foreach ($ports as $port){
$connection = @fsockopen($host, $port, $errno, $errstr, 2);
if (is_resource($connection)){
echo '<h2>' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.</h2>' . "\n";
fclose($connection);
} else{
echo '<h2>' . $host . ':' . $port . ' is not responding.</h2>' . "\n";
}
}
複製代碼
文章出處
https://gist.github.com/akalongman/b50bc11a9303adb6f2db
歡迎光臨 TShopping (http://www.tshopping.com.tw/)
Powered by Discuz! X3.2