<?
//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;
}
?>
<FORM>
<INPUT TYPE=HIDDEN NAME=action VALUE=query>
Site: <INPUT TYPE=TEXT NAME=server VALUE="<?echo $server?>"> <SMALL>(ie: www.wackowoh.com)</SMALL><BR>
Port: <INPUT TYPE=TEXT NAME=port VALUE="80" SIZE="5" MAXLENGTH="5"><BR>
<INPUT TYPE=SUBMIT VALUE=" OK ">
</FORM>
<?
if($action == "query") {
$data = http_request($server, $port);
echo "Connected To $server on port $port.<p>";
echo "Output: <p><pre>$data</pre><p>";
}
?>
//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;
}
?>
<FORM>
<INPUT TYPE=HIDDEN NAME=action VALUE=query>
Site: <INPUT TYPE=TEXT NAME=server VALUE="<?echo $server?>"> <SMALL>(ie: www.wackowoh.com)</SMALL><BR>
Port: <INPUT TYPE=TEXT NAME=port VALUE="80" SIZE="5" MAXLENGTH="5"><BR>
<INPUT TYPE=SUBMIT VALUE=" OK ">
</FORM>
<?
if($action == "query") {
$data = http_request($server, $port);
echo "Connected To $server on port $port.<p>";
echo "Output: <p><pre>$data</pre><p>";
}
?>
版权声明:
本站所有资源均为站长或网友整理自互联网或站长购买自互联网,站长无法分辨资源版权出自何处,所以不承担任何版权以及其他问题带来的法律责任,如有侵权或者其他问题请联系站长删除!站长QQ754403226 谢谢。
- 上一篇: PHP4实际应用经验篇(3)
- 下一篇: 一个简单的域名注册情况查询程序