Php做的端口嗅探器--可以指定网站和端口
发布时间:2006-10-14 2:44:48   收集提供:gaoqian
<?
  //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>";
    }
    ?> 
 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50