腾讯检测网址API制作

2019年10月6日09:48:08 1 1,084

呦呦呦!好久没更新了!来更新一发吧!biu!

抓包

看到很多小伙伴弄了安全网址检测api或者功能,我也想弄一个,可是遇到了一个问题:

抓包抓取到的api,打开竟然是空白的!!

腾讯检测网址API制作

这原来是小伎俩,我猜腾讯是为了防止API被滥用做的Referer检测,那,用curl模拟Referer网址不就得了么?

成品

这里就为大家制作了一个二次腾讯检测网址的api成品

<?php
header('Content-Type:application/json; charset=utf-8');
function 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);
  $response = curl_exec($ch);
  if($error=curl_error($ch)){
    die($error);
  }
  curl_close($ch);
  return $response;
}
// 调用
$url = 'https://cgi.urlsec.qq.com/index.php?m=check&a=check&url='.$_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['data']['results']['url'];
	$type = $data['data']['results']['whitetype'];
	$beian = $data['data']['results']['isDomainICPOk'];
	$icpdode = $data['data']['results']['ICPSerial'];
	$icporg = $data['data']['results']['Orgnization'];
	$word = $data['data']['results']['Wording'];
	$wordtit = $data['data']['results']['WordingTitle'];
	$json = [
	    'url' => $url,
	    'type' => $type,
	    'beian' => $beian,
	    'icpdode' => $icpdode,
	    'icporg' => $icporg,
	    'word' => $word,
	    'wordtit' => $wordtit,
	    ];
	exit(json_encode($json));
?>

将api搭建好后,变量url就为检测的网址,如(example.com/index.php?url=xxx.com)

json解析出来的参数结果解释如下:

参数说明
url检测的网址
type网址类型:
"1",则网址未知(包括腾讯云绿标)
"2",则网址报毒
"3",则网址安全(即有付费的绿标)
beian是否备案:
"1",则已经备案
"0",则未备案
beiancode备案号,未备案则空
beianorg备案主体,未备案则空
word报毒原因,未报毒则空
wordtit报毒原因标题,未报毒则空

希望对一些人有帮助!

weinxin
滑稽社
流星博客建立的官方交流群,包含技术交流|随意闲聊|好友扩列|热心管理在一体的技术群

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:1   其中:访客  1   博主  0

    • avatar 寒穹 1

      我觉得这种接口没什么用,,,没实用性