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

Method __init__

api/fofa.py:15–43  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

13
14class Fofa:
15 def __init__(self):
16 self.email = Fofa_email
17 self.key = Fofa_key
18 self.size = Fofa_Size
19 self.headers = {
20 "User-Agent": random.choice(user_agents)
21 }
22 if self.check():
23 if Ips.ip:
24 for ip in Ips.ip:
25 ip = "ip={}".format(ip)
26 self.run(ip)
27 else:
28 try:
29 logging.info("[FOFA Example]domain=example.com\n")
30 while 1:
31 keyword = input("请输入查询关键词:").strip()
32 size = input("请输入查询的数量(默认100):").strip()
33 self.size = int(size) if size else 100
34 if keyword == "":
35 logging.error("\n关键字不能为空!")
36 else:
37 break
38 self.run(keyword)
39 except KeyboardInterrupt:
40 logging.error("\n用户取消输入!直接退出。")
41 exit(0)
42 else:
43 logging.error("fofa api不可用,请检查配置是否正确!")
44
45 def run(self,keyword):
46 logging.info("正在调用fofa进行收集资产。。。。")

Callers

nothing calls this directly

Calls 4

checkMethod · 0.95
runMethod · 0.95
infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected