Php做的端口嗅探器--可以指定网站和端口
时间:2020-10-12 19:22:12|栏目:PHP代码|点击: 次
<?
//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>";
}
?>
上一篇:PHP基于php_imagick_st-Q8.dll实现JPG合成GIF图片的方法
栏 目:PHP代码
本文地址:http://www.codeinn.net/misctech/10343.html