MCPcopy
hub / github.com/NullArray/AutoSploit / search

Method search

api_calls/censys.py:27–45  ·  view source on GitHub ↗

connect to the Censys API and pull all IP addresses from the provided query

(self)

Source from the content-addressed store, hash-verified

25 self.save_mode = save_mode
26
27 def search(self):
28 """
29 connect to the Censys API and pull all IP addresses from the provided query
30 """
31 discovered_censys_hosts = set()
32 try:
33 lib.settings.start_animation("searching Censys with given query '{}'".format(self.query))
34 req = requests.post(
35 API_URLS["censys"], auth=(self.id, self.token),
36 json={"query": self.query}, headers=self.user_agent,
37 proxies=self.proxy
38 )
39 json_data = req.json()
40 for item in json_data["results"]:
41 discovered_censys_hosts.add(str(item["ip"]))
42 write_to_file(discovered_censys_hosts, self.host_file, mode=self.save_mode)
43 return True
44 except Exception as e:
45 raise AutoSploitAPIConnectionError(str(e))

Callers 8

download_modulesFunction · 0.45
do_api_searchMethod · 0.45
do_scanFunction · 0.45
start_exploitMethod · 0.45
single_run_argsMethod · 0.45
check_version_numberFunction · 0.45
ensure_no_issueFunction · 0.45
find_urlFunction · 0.45

Calls 2

write_to_fileFunction · 0.90

Tested by

no test coverage detected