Skip to content

Commit 8b02acb

Browse files
authored
Merge pull request #2995 from blacklanternsecurity/asndb-no-verify
Use asndb verify=False, respect global ssl_verify config
2 parents 007424f + 29be8cd commit 8b02acb

6 files changed

Lines changed: 15 additions & 13 deletions

File tree

bbot/core/event/helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def _sanitize_and_extract_host(self, data):
112112
"""
113113
return data, None, None
114114

115-
async def _generate_children(self):
115+
async def _generate_children(self, ssl_verify=False):
116116
return []
117117

118118
def _override_input(self, input):
@@ -294,10 +294,10 @@ def _override_input(self, input):
294294
# ASNs are essentially just a superset of IP_RANGES.
295295
# This method resolves the ASN to a list of IP_RANGES using the ASN API, and then adds the cidr string as a child event seed.
296296
# These will later be automatically resolved to an IP_RANGE event seed and added to the target.
297-
async def _generate_children(self):
297+
async def _generate_children(self, ssl_verify=False):
298298
from asndb import ASNDB
299299

300-
client = ASNDB()
300+
client = ASNDB(verify=ssl_verify)
301301
asn_data = await client.lookup_asn(str(self.data), include_subnets=True)
302302
children = []
303303
if asn_data:

bbot/core/helpers/asn.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def client(self):
2828
if self._client is None:
2929
from asndb import ASNDB
3030

31-
self._client = ASNDB()
31+
ssl_verify = self.parent_helper.web_config.get("ssl_verify", False)
32+
self._client = ASNDB(verify=ssl_verify)
3233
return self._client
3334

3435
def _normalize(self, response):

bbot/scanner/scanner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ async def _prep(self):
293293
creates the scan's output folder, loads its modules, and calls their .setup() methods.
294294
"""
295295
# expand async seed types (e.g. ASN → IP ranges)
296-
await self.preset.target.generate_children()
296+
ssl_verify = self.preset.web_config.get("ssl_verify", False)
297+
await self.preset.target.generate_children(ssl_verify=ssl_verify)
297298

298299
# evaluate preset conditions (may abort the scan)
299300
if self.preset.conditions:

bbot/scanner/target.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def in_target(self, host):
415415
def __eq__(self, other):
416416
return self.hash == other.hash
417417

418-
async def generate_children(self):
418+
async def generate_children(self, ssl_verify=False):
419419
"""
420420
Generate children for the target, for seed types that expand into other seed types.
421421
E.g. ASN targets are expanded into their constituent IP ranges.
@@ -426,13 +426,13 @@ async def generate_children(self):
426426

427427
# Expand seeds first
428428
for event_seed in list(self.seeds.event_seeds):
429-
children = await event_seed._generate_children()
429+
children = await event_seed._generate_children(ssl_verify=ssl_verify)
430430
for child in children:
431431
self.seeds.add(child)
432432

433433
# Also expand blacklist event seeds (like ASN targets)
434434
for event_seed in list(self.blacklist.event_seeds):
435-
children = await event_seed._generate_children()
435+
children = await event_seed._generate_children(ssl_verify=ssl_verify)
436436
for child in children:
437437
self.blacklist.add(child)
438438

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies = [
4343
"puremagic>=1.28,<2",
4444
"pydantic>=2.12.2,<3",
4545
"radixtarget>=4.0.1,<5",
46-
"asndb>=1.0.0",
46+
"asndb>=1.0.4",
4747
"orjson>=3.10.12,<4",
4848
"ansible-core>=2.17,<3",
4949
"tldextract>=5.3.0,<6",

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)