Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NSEC Infinite Loop Bug #737

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bbot/modules/nsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ async def get_nsec_record(self, domain):
self.warning(f"Error getting NSEC record for {domain}: {e}")

async def nsec_walk(self, domain):
encountered = set()
current_domain = domain
while 1:
next_domain = await self.get_nsec_record(current_domain)
if next_domain == domain or next_domain is None:
if next_domain is None or next_domain in encountered:
break
encountered.add(next_domain)
if not next_domain.startswith("\\"):
yield next_domain
current_domain = next_domain