Php做的端口嗅探器--可以指定网站和端口
程序员文章站
2022-03-04 16:05:52
//php做的端口嗅探器--可以指定网站和端口 //并返回嗅探结果 function h...
<?
//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>";
}
?>