Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Nov 6, 2024
1 parent a2a0123 commit d0daea4
Show file tree
Hide file tree
Showing 24 changed files with 27 additions and 35 deletions.
2 changes: 1 addition & 1 deletion bbot/modules/anubisdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def abort_if(self, event):
return True, "DNS name is unresolved"
return await super().abort_if(event)

def parse_results(self, r, query):
async def parse_results(self, r, query):
results = set()
json = r.json()
if json:
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/binaryedge.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ async def request_url(self, query):
url = f"{self.base_url}/query/domains/subdomain/{self.helpers.quote(query)}"
return await self.api_request(url)

def parse_results(self, r, query):
async def parse_results(self, r, query):
j = r.json()
return j.get("events", [])
2 changes: 1 addition & 1 deletion bbot/modules/bufferoverrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def request_url(self, query):
url = f"{self.commercial_base_url if self.commercial else self.base_url}?q=.{query}"
return await self.api_request(url)

def parse_results(self, r, query):
async def parse_results(self, r, query):
j = r.json()
subdomains_set = set()
if isinstance(j, dict):
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/c99.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def request_url(self, query):
url = f"{self.base_url}/subdomainfinder?key={{api_key}}&domain={self.helpers.quote(query)}&json"
return await self.api_request(url)

def parse_results(self, r, query):
async def parse_results(self, r, query):
j = r.json()
if isinstance(j, dict):
subdomains = j.get("subdomains", [])
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/certspotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def request_url(self, query):
url = f"{self.base_url}/issuances?domain={self.helpers.quote(query)}&include_subdomains=true&expand=dns_names"
return self.api_request(url, timeout=self.http_timeout + 30)

def parse_results(self, r, query):
async def parse_results(self, r, query):
json = r.json()
if json:
for r in json:
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/chaos.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def request_url(self, query):
url = f"{self.base_url}/{domain}/subdomains"
return await self.api_request(url)

def parse_results(self, r, query):
async def parse_results(self, r, query):
j = r.json()
subdomains_set = set()
if isinstance(j, dict):
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/columbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async def request_url(self, query):
url = f"{self.base_url}/{self.helpers.quote(query)}?days=365"
return await self.api_request(url)

def parse_results(self, r, query):
async def parse_results(self, r, query):
results = set()
json = r.json()
if json and isinstance(json, list):
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/crt.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async def request_url(self, query):
url = self.helpers.add_get_params(self.base_url, params).geturl()
return await self.api_request(url, timeout=self.http_timeout + 30)

def parse_results(self, r, query):
async def parse_results(self, r, query):
j = r.json()
for cert_info in j:
if not type(cert_info) == dict:
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/digitorus.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async def request_url(self, query):
url = f"{self.base_url}/{self.helpers.quote(query)}"
return await self.helpers.request(url)

def parse_results(self, r, query):
async def parse_results(self, r, query):
results = set()
content = getattr(r, "text", "")
extract_regex = re.compile(r"[\w.-]+\." + query, re.I)
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/fullhunt.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ async def request_url(self, query):
response = await self.api_request(url)
return response

def parse_results(self, r, query):
async def parse_results(self, r, query):
return r.json().get("hosts", [])
2 changes: 1 addition & 1 deletion bbot/modules/hackertarget.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async def request_url(self, query):
response = await self.api_request(url)
return response

def parse_results(self, r, query):
async def parse_results(self, r, query):
for line in r.text.splitlines():
host = line.split(",")[0]
try:
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/leakix.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def request_url(self, query):
response = await self.api_request(url)
return response

def parse_results(self, r, query=None):
async def parse_results(self, r, query=None):
json = r.json()
if json:
for entry in json:
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/myssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async def request_url(self, query):
url = f"{self.base_url}?domain={self.helpers.quote(query)}"
return await self.api_request(url)

def parse_results(self, r, query):
async def parse_results(self, r, query):
results = set()
json = r.json()
if json and isinstance(json, dict):
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/otx.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def request_url(self, query):
url = f"{self.base_url}/api/v1/indicators/domain/{self.helpers.quote(query)}/passive_dns"
return self.api_request(url)

def parse_results(self, r, query):
async def parse_results(self, r, query):
j = r.json()
if isinstance(j, dict):
for entry in j.get("passive_dns", []):
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/passivetotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def request_url(self, query):
url = f"{self.base_url}/enrichment/subdomains?query={self.helpers.quote(query)}"
return await self.api_request(url, auth=self.auth)

def parse_results(self, r, query):
async def parse_results(self, r, query):
for subdomain in r.json().get("subdomains", []):
yield f"{subdomain}.{query}"

Expand Down
8 changes: 2 additions & 6 deletions bbot/modules/rapiddns.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ async def request_url(self, query):
response = await self.api_request(url, timeout=self.http_timeout + 10)
return response

def parse_results(self, r, query):
async def parse_results(self, r, query):
results = set()
text = getattr(r, "text", "")
for match in self.helpers.regexes.dns_name_regex.findall(text):
match = match.lower()
if match.endswith(query):
results.add(match)
return results
return await self.scan.extract_in_scope_hostnames(text)
2 changes: 1 addition & 1 deletion bbot/modules/securitytrails.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def request_url(self, query):
response = await self.api_request(url)
return response

def parse_results(self, r, query):
async def parse_results(self, r, query):
j = r.json()
if isinstance(j, dict):
for host in j.get("subdomains", []):
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/shodan_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ async def handle_event(self, event):
def make_url(self, query):
return f"{self.base_url}/dns/domain/{self.helpers.quote(query)}?key={{api_key}}&page={{page}}"

def parse_results(self, json, query):
async def parse_results(self, json, query):
return [f"{sub}.{query}" for sub in json.get("subdomains", [])]
2 changes: 1 addition & 1 deletion bbot/modules/subdomaincenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def request_url(self, query):
break
return response

def parse_results(self, r, query):
async def parse_results(self, r, query):
results = set()
json = r.json()
if json and isinstance(json, list):
Expand Down
4 changes: 2 additions & 2 deletions bbot/modules/templates/subdomain_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def make_query(self, event):
break
return ".".join([s for s in query.split(".") if s != "_wildcard"])

def parse_results(self, r, query=None):
async def parse_results(self, r, query=None):
json = r.json()
if json:
for hostname in json:
Expand All @@ -123,7 +123,7 @@ async def query(self, query, request_fn=None, parse_fn=None):
self.info(f'Query "{query}" failed (no response)')
return []
try:
results = list(parse_fn(response, query))
results = list(await parse_fn(response, query))
except Exception as e:
if response:
self.info(
Expand Down
2 changes: 1 addition & 1 deletion bbot/modules/trickest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def make_url(self, query):
url += "&limit={page_size}&offset={offset}&select=hostname&orderby=hostname"
return url

def parse_results(self, j, query):
async def parse_results(self, j, query):
results = j.get("results", [])
subdomains = set()
for item in results:
Expand Down
8 changes: 2 additions & 6 deletions bbot/modules/virustotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ def prepare_api_request(self, url, kwargs):
kwargs["headers"]["x-apikey"] = self.api_key
return url, kwargs

def parse_results(self, r, query):
async def parse_results(self, r, query):
results = set()
text = getattr(r, "text", "")
for match in self.helpers.regexes.dns_name_regex.findall(text):
match = match.lower()
if match.endswith(query):
results.add(match)
return results
return await self.scan.extract_in_scope_hostnames(text)
2 changes: 1 addition & 1 deletion bbot/modules/zoomeye.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ async def query(self, query):
agen.aclose()
return results

def parse_results(self, r):
async def parse_results(self, r):
for entry in r.get("list", []):
yield entry["name"]
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async def setup_after_prep(self, module_test):
tags=["shortname-file"],
)
)
module_test.scan.target.seeds._events = set(seed_events)
module_test.scan.target.seeds.events = set(seed_events)

expect_args = {"method": "GET", "uri": "/administrator.aspx"}
respond_args = {"response_data": "alive"}
Expand Down

0 comments on commit d0daea4

Please sign in to comment.