同IP网站查询PHP

折腾 47 字 701 阅

简言

对接aizhan.com,获取同IP网站,返回同IP网站数量及前十五条信息相关域名。

PHP

<?php
error_reporting(0);
$id = urlencode($_GET["ip"]);
if(!$id){echo "抱歉,输入为空。";exit;}
$data=get("https://dns.aizhan.com/".$id."/");
preg_match_all("/<span class=\"red\">(.*?)</",$data,$g);
echo "共有".$g[1][0]."个域名指向该IP\n\n";
$s=preg_match_all("/\" rel=\"nofollow\" target=\"_blank\">(.*?)</",$data,$g);
if($s=="0"){exit("无域名指向该IP。");}
for( $i = 0 ; $i < $s && $i < 15 ; $i ++ ){
echo ($i+1)."、".$g[1][$i]."\n\n";}
function get($url,$data=0,$header_array=0,$referer=0,$time=30,$code=0) {
    if($header_array==0) {
        $header=array("CLIENT-IP: ".ip(),"X-FORWARDED-FOR: ".ip(),'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36');
    } else {
        $header=array("CLIENT-IP: ".ip(),"X-FORWARDED-FOR: ".ip(),'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36');
        $header=array_merge($header_array,$header);
    }
//print_r($header);
    $curl=curl_init();
    curl_setopt($curl,CURLOPT_URL,$url);
    curl_setopt($curl,CURLOPT_HTTPHEADER,$header);
    if($data) {
        curl_setopt($curl,CURLOPT_POST,1);
        curl_setopt($curl,CURLOPT_POSTFIELDS,$data);
    }
    if($referer) {
        curl_setopt($curl,CURLOPT_REFERER,$referer);
    }
    curl_setopt($curl,CURLOPT_TIMEOUT,$time);
    curl_setopt($curl,CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
    curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($curl,CURLOPT_SSL_VERIFYHOST, FALSE);
    curl_setopt($curl,CURLOPT_ENCODING,'gzip,deflate');
if($code) {
        curl_setopt($curl, CURLOPT_HEADER, 1);
        $return=curl_exec($curl);
        $code_code=curl_getinfo($curl);
        curl_close($curl);
        $code_int['exec']=substr($return,$code_code["header_size"]);
        $code_int['code']=$code_code["http_code"];
        $code_int['content_type']=$code_code["content_type"];
        $code_int['header']=substr($return,0,$code_code["header_size"]);
        return $code_int;
    } else {
        $return=curl_exec($curl);
        curl_close($curl);
        return $return;
    }
}
function ip() {
    $ip_long = array(
                    array('607649792', '608174079'),
                    array('1038614528', '1039007743'),
                    array('1783627776', '1784676351'),
                    array('2035023872', '2035154943'),
                    array('2078801920', '2079064063'),
                    array('-1950089216', '-1948778497'),
                    array('-1425539072', '-1425014785'),
                    array('-1236271104', '-1235419137'),
                    array('-770113536', '-768606209'),
                    array('-569376768', '-564133889'),
                    );
    $rand_key=mt_rand(0,9);
    return $ip=long2ip(mt_rand($ip_long[$rand_key][0], $ip_long[$rand_key][1]));
}

function replace_unicode_escape_sequence($match){
  return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');}
?>
- THE END -
打赏 分享
评论 ( 5 )
OωO
  1. kbysgegrvd

    同IP网站查询PHP - 从南小站-致我逝去的青春
    akbysgegrvd
    [url=http://www.g843diy4oui5go37b4h75zd765uj96m0s.org/]ukbysgegrvd[/url]
    kbysgegrvd http://www.g843diy4oui5go37b4h75zd765uj96m0s.org/

    3月11日 回复
  2. Elizbeth Zaragoza
    Elizbeth Zaragoza

    Do you need more clients?

    We have amazing databases starting at $9.99 until the end of the Month!

    Visit us at StarDataGroup.com

    2月24日 回复
  3. Jamel Paquette
    Jamel Paquette

    It is with sad regret to inform you StarDataGroup.com is shutting down.

    Fire sale till the 7th of Feb.

    Any group of databases listed below is $49 or $149 for all 16 databases in this one time offer.
    You can purchase it at www.StarDataGroup.com and view samples.

    LinkedIn Database
    43,535,433 LinkedIn RecordsUSA B2B Companies Database
    28,147,835 CompaniesForex
    Forex South Africa 113,550 Forex Traders

    Forex Australia 135,696 Forex Traders
    Forex UK 779,674 Forex Traders

    UK Companies Database
    521,303 CompaniesGerman Databases
    German Companies Database: 2,209,191 Companies

    German Executives Database: 985,048 Executives

    Australian Companies Database
    1,806,596 CompaniesUAE Companies Database
    950,652 CompaniesAffiliate Marketers Database
    494,909 recordsSouth African Databases
    B2B Companies Database: 1,462,227 Companies

    Directors Database: 758,834 Directors
    Healthcare Database: 376,599 Medical Professionals
    Wholesalers Database: 106,932 Wholesalers
    Real Estate Agent Database: 257,980 Estate Agents
    Forex South Africa: 113,550 Forex Traders

    Visit www.stardatagroup.com or contact us with any queries.

    Kind Regards,
    StarDataGroup.com

    2月4日 回复
  4. Dannielle Brandt
    Dannielle Brandt

    Use SendBulkMails.com to run email campaigns from your own private dashboard.

    Cold emails are allowed and won't get you blocked :)

    Starter Package 50% off sale

    1Mil emails / mo @ $99 USDDedicated IP and Domain IncludedDetailed statistical reports (delivery, bounce, clicks etc.)Quick and easy setup with extended support at no extra cost.Cancel anytime!

    Regards,
    www.SendBulkMails.com

    2月2日 回复
  5. Flossie Winning
    Flossie Winning

    It is with sad regret to inform you StarDataGroup.com is shutting down.
    It has been a tough year all round and we decided to go out with a bang!

    Any group of databases listed below is $49 or $149 for all 16 databases in this one time offer.
    You can purchase it at www.StarDataGroup.com and view samples.

    LinkedIn Database
    43,535,433 LinkedIn RecordsUSA B2B Companies Database
    28,147,835 CompaniesForex
    Forex South Africa 113,550 Forex Traders

    Forex Australia 135,696 Forex Traders
    Forex UK 779,674 Forex Traders

    UK Companies Database
    521,303 CompaniesGerman Databases
    German Companies Database: 2,209,191 Companies

    German Executives Database: 985,048 Executives

    Australian Companies Database
    1,806,596 CompaniesUAE Companies Database
    950,652 CompaniesAffiliate Marketers Database
    494,909 recordsSouth African Databases
    B2B Companies Database: 1,462,227 Companies

    Directors Database: 758,834 Directors
    Healthcare Database: 376,599 Medical Professionals
    Wholesalers Database: 106,932 Wholesalers
    Real Estate Agent Database: 257,980 Estate Agents
    Forex South Africa: 113,550 Forex Traders

    Visit www.stardatagroup.com or contact us with any queries.

    Kind Regards,
    StarDataGroup.com

    1月21日 回复
感谢打赏