批量检测域名是否被微信拦截源码

批量检测域名是否被微信拦截源码_第1张图片

// 填入待检测的域名列表
$domainList = array(
    'https://hty.ycxiaoqwl.com/',
    'google.com',
    'baidu.com',
    'https://www.lzcfz7.xyz/'
);

// 遍历域名列表进行检测
foreach ($domainList as $domain) {
    $url = "https://down.ychengsnsm.com/wx/?url={$domain}";

    // 发送 HTTP 请求
    $curl = curl_init();
    curl_setopt_array($curl, array(
        CURLOPT_URL => $url,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
        CURLOPT_SSL_VERIFYPEER => false,
    ));
    $response = curl_exec($curl);
    $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
    curl_close($curl);

    // 解析响应结果
    if (strpos($response, '域名被封') === false) {
        // 检测域名正常
        echo "域名 {$domain} 正常\n";
        echo "
";
    } else {
        // 检测域名被封
        echo "域名 {$domain} 被封\n";
        echo "
";
    }
}
?>
 

你可能感兴趣的:(微信)