Php端口嗅探器(能指定网站和端口)
程序员文章站
2024-01-25 11:25:16
...
//Php端口嗅探器(能指定网站和端口)
function http_request($server, $port) {
$data = "";
$query = "HEAD / HTTP/1.0";
$fp = fsockopen($server, $port);
if($fp) {
fputs($fp, $query."rnn");
while(!feof($fp)) {
$data .= fread($fp, 1000);
}
fclose($fp);
}
return $data;
}
?>
if($action == "query") {
$data = http_request($server, $port);
echo "Connected To $server on port $port.
function http_request($server, $port) {
$data = "";
$query = "HEAD / HTTP/1.0";
$fp = fsockopen($server, $port);
if($fp) {
fputs($fp, $query."rnn");
while(!feof($fp)) {
$data .= fread($fp, 1000);
}
fclose($fp);
}
return $data;
}
?>
if($action == "query") {
$data = http_request($server, $port);
echo "Connected To $server on port $port.
";
echo "Output:
$data
";
}
?>
以上就介绍了Php端口嗅探器(能指定网站和端口),包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
上一篇: php中smarty实现多模版网站的方法
下一篇: php 操作数组有关问题