当我浏览 URL 时(小心!钓鱼网站): http://www(dot)onlinevisibilityinc(dot)com/ GOOGLE 向我发出钓鱼警报。
当我尝试使用 Google 安全浏览并检查此 url 时,收到的状态代码为 200,但响应 json 为空(这意味着此 url 在他们的文档中是干净的)。
我又尝试了 5 个 URL(取自https://phishbank.org/#/),但它们都给了我保存结果,所以我做错了。
你能帮我吗?我试过很多,但我还没有找到问题。提前致谢!
我的python演示代码:
import json
import requests
GOOGLE_SB_LOOKUP_URL = 'https://safebrowsing.googleapis.com/v4/threatMatches:find'
params = {
'key': '<MY_API_KEY>',
}
headers = {
'User-Agent': '<MY_USER_AGENT>',
'Content-Type': 'application/json'
}
data = {
'client': {
'clientId': 'TestClientID',
'clientVersion': '1.0.0.0'
},
'threatInfo': {
'threatTypes': ['THREAT_TYPE_UNSPECIFIED', 'MALWARE', 'SOCIAL_ENGINEERING', 'UNWANTED_SOFTWARE',
'POTENTIALLY_HARMFUL_APPLICATION'],
'platformTypes': ['ANY_PLATFORM'],
'threatEntryTypes': ['URL'],
'threatEntries': [
{'url': 'http://www.onlinevisibilityinc.com/'},
]
}
}
response = requests.post(GOOGLE_SB_LOOKUP_URL, params=params, headers=headers, data=json.dumps(data))
status_code = response.status_code
if status_code == 200:
json_response = response.json()
else:
json_response = {}
print ('Google Status Code: {0}'.format(status_code))
print ('Google Result: {0}'.format(json_response))
输出:
Google Status Code: 200
Google Result: {}