抓包
我看到很多朋友做了安全URL检测的api或者函数。我也想做一个,但是遇到了一个问题:
抓包抓到的api打开后竟然是空白!
事实证明这是一个诡计。我猜腾讯做了Referer检测是为了防止API被滥用。那么,用curl来模拟referer URL不就可以了吗?
成品
这里有一个api成品供您制作二次腾讯检测网址
?phpheader('Content-Type:application/json; charset=utf-8');函数doCurl($url, $data=array(), $header=array(), $referer='', $timeout=30){ $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data )); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_REFERER, $referer); $响应=curl_exec($ch); if($error=curl_error ($ch)){ die($error); } }curl_close($ch); return $response;}//调用$url='https://cgi.urlsec.qq.com/index.php?m=checka=checkurl=' .$_GET@['url'];$data=array();//设置IP$header=array( 'CLIENT-IP: 192.168.1.100', 'X-FORWARDED-FOR: 192.168.1.100'); $referer='https://urlsec.qq.com/'; $response=doCurl($url, $data, $header, $referer, 5); $data=substr($response, 1, -1); $data=json_decode($data, true); $url=$data['数据']['结果']['url']; $type=$data['data']['结果']['whitetype']; $beian=$data ['数据']['结果']['isDomainICPOk']; $icpdode=$data['数据']['结果']['ICPSerial']; $icporg=$data['数据']['结果']['组织'];$word=$data['数据']['结果']['措辞'];$wordtit=$data['数据']['结果']['WordingTitle']; $json=[ 'url'=$url, 'type'=$type, 'beian'=$beian, 'icpdode'=$icpdode, 'icporg'=$icporg, 'word'=$word, 'wordtit'=$wordtit, ];退出(json_encode($json));复制并构建api后,变量url是检测到的URL,例如(example.com/index.php?url=xxx.com):
json解析出来的参数结果解释如下:
参数
阐明
网址
检测到的URL
类型
URL类型:如果为'1',则该URL未知(包括腾讯云绿标),如果为'2',如果该URL中毒,则为'3',该URL是安全的(即,有付费绿色标签)
北岸
是否备案:'1',已备案; ‘0’,尚未归档
贝安码
记录编号,未注册则为空
北安奥格
记录主题,如果不归档则为空
单词
举报中毒原因,若未举报中毒则为空
词山雀
中毒报告原因标题,如果没有中毒报告则为空
希望能帮助一些人!