微步在线云API-调用代码
微步官方调用连接:API 文档实例接口调用代码:#!/usr/bin/python# -*- coding: UTF-8 -*-import requests,jsonclass intelligenceSearch():def __init__(self):self.search_url="https://api.threatbook.cn/v3/ip/query"self.api_key ="
·
实例接口调用代码:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import requests,json
class intelligenceSearch():
def __init__(self):
self.search_url="https://api.threatbook.cn/v3/ip/query"
self.api_key ="******请替换apikey"
def getIpIoc(self,ip):
params = {
"data": ip,
"apiKey": self.api_key,
}
result_ip_list = []
print("ip params:", params)
resp = requests.get(self.search_url, params=params, verify=False)
print("ip type of resp:", type(resp.json()))
print("ip resp.json:", resp.json())
res_dict = json.loads(resp.text)
record_content = res_dict.get('content')
print("len of record_content:",len(record_content),type(record_content),type(record_content[0]))
print("record_content:",record_content)
def getDnsIoc(self,dns):
params = {
"data": dns,
"apiKey": self.api_key,
}
print("dns params:", params)
resp = requests.get(self.search_url, params=params, verify=False)
print("dns type of resp:", type(resp.json()))
print("dns resp.json:", resp.json())
res_dict = json.loads(resp.text)
record_content = res_dict.get('content')
print("len of record_content:", len(record_content), type(record_content), type(record_content[0]))
print("record_content:", record_content)
if __name__ == '__main__':
print("weibu test begin:")
querier = intelligenceSearch()
print("AAAAAAAAAA ip test:")
querier.getIpIoc("19.29..24,9.9.36.24")
print("BBBBBBBBBB dns test:")
querier.getDnsIoc("nawqned.com,119.19.26.24")

GitCode 天启AI是一款由 GitCode 团队打造的智能助手,基于先进的LLM(大语言模型)与多智能体 Agent 技术构建,致力于为用户提供高效、智能、多模态的创作与开发支持。它不仅支持自然语言对话,还具备处理文件、生成 PPT、撰写分析报告、开发 Web 应用等多项能力,真正做到“一句话,让 Al帮你完成复杂任务”。
更多推荐
所有评论(0)