• IP反向查询工具

    Posted on 三月 4th, 2009 inetdemon No comments

    现在国内使用wordpress的用户不少,很多采用自建博客后租用虚拟空间,那么空间的服务就很重要,这里介绍一个简单的IP反向查询工具,帮助大家了解一下自己的服务器上同一IP有多少个域名,也就可以了解你的hosting供应商有多黑了。

    查询同一IP下不同域名:
    $ip=trim($_POST['ip']);
    if(!empty($ip) && !eregi("([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})",$ip)){
    echo "IP地址格式不正确!请重新输入“;
    $ip=”";
    }
    ?>

    onMouseOver=”this.focus()” onFocus=”this.select();this.style.color=’#000000′” onClick=”if (this.value==’输入IP’) this.value=”” onblur=”if(this.value ==”||this.value==’输入IP’){this.value=’输入IP’;this.style.color=’#cccccc’}” style=”width: 100px;color:#999999;”>

    if (!empty($ip)){
    include "Snoopy.class.php";
    $snoopy = new Snoopy ( );
    $snoopy->agent = “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)”;
    $snoopy->rawheaders ["Pragma"] = “no-cache”;
    $snoopy->expandlinks = true;
    $refer = “http://www.domaintools.com/reverse-ip/”;
    $snoopy->cookies["nisession"] = ‘w4yyoBRKlMOaEuWxuw4mxc9agwAlZGPRjKbzJKmFStw%253D’;
    $snoopy->referer = $refer;
    //$snoopy->user = “joe”;
    //$snoopy->pass = “bloe”;
    //$snoopy->rawheaders["X_FORWARDED_FOR"] = “127.0.0.101″;
    $snoopy->rawheaders["X-Requested-With"] = “XMLHttpRequest”;

    $submit_url = “http://www.domaintools.com/reverse-ip/functions.html?s=preview”;

    $submit_vars ["ip"] = $ip;
    $submit_vars ["_"] = “”;

    if ($snoopy->submit ( $submit_url, $submit_vars )) {
    preg_match ( “/

  • (.*)<\/li>/is”, $snoopy->results, $table );
    $art_list=explode(“\n”,trim(strip_tags($table[0])));
    echo “查询结果如下:
      “;
      foreach ( $art_list as $art_node ) {
      $tmp=trim($art_node);
      if (!empty($tmp))
      echo “
    • “. $art_node .”
    • “;
      }
      echo “

    “;
    } else
    echo “error fetching document: ” . $snoopy->error . “\n”;
    }//end of if empty ip
    ?>
    该IP的反向查询主机信息:

    你也可以使用如下IP反向查询多个域名的工具

    http://www.find-ip-address.org/reverse_lookup/

    http://www.myipneighbors.com/ 这个好像已经被黑掉了
    如果你用的是虚拟主机,要注意防范旁注攻击

    Leave a reply