MCPcopy Create free account
hub / github.com/EASY233/Finger / run

Method run

api/quake.py:39–64  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

37
38
39 def run(self):
40 logging.info("正在使用使用360 Quake进行资产收集。。。")
41 logging.info("查询关键词为:{0},查询数量为:{1}".format(self.keywords, self.size))
42 self.data = {
43 "query": self.keywords,
44 "start": 0,
45 "size": self.size
46 }
47 try:
48 response = requests.post(url="https://quake.360.cn/api/v3/search/quake_service", headers=self.headers,
49 json=self.data, timeout=10)
50 datas = json.loads(response.text)
51 if len(datas['data']) >= 1 and datas['code'] == 0:
52 for data in datas['data']:
53 port = "" if data['port'] == 80 or data["port"] == 443 else ":{}".format(str(data['port']))
54 if 'http/ssl' == data['service']['name']:
55 url = 'https://' + data['service']['http']['host'] + port
56 logging.info(url)
57 Urls.url.append(url)
58 elif 'http' == data['service']['name']:
59 url = 'http://' + data['service']['http']['host'] + port
60 logging.info(url)
61 Urls.url.append(url)
62 except Exception as e:
63 logging.error("获取失败")
64 pass

Callers 1

__init__Method · 0.95

Calls 2

infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected