Skip to content

Commit

Permalink
exception handling improved in dns module
Browse files Browse the repository at this point in the history
  • Loading branch information
thewhiteh4t committed Aug 6, 2024
1 parent 6cfd9ad commit 2074bbd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ async def fetch_records(res, domain, record):
print(f'{C}DMARC \t: {W}{entry.to_text()}')
if output != 'None':
result.setdefault('dmarc', []).append(f'DMARC : {entry.to_text()}')
except dns.resolver.NoAnswer as exc:
log_writer(f'[dns.dmarc] Exception = {exc}')
except dns.resolver.NoMetaqueries as exc:
log_writer(f'[dns.dmarc] Exception = {exc}')
except dns.resolver.NoNameservers as exc:
log_writer(f'[dns.dmarc] Exception = {exc}')
except dns.resolver.NXDOMAIN as exc:
log_writer(f'[dns.dmarc] Exception = {exc}')
print(f'\n{R}[-] {C}DMARC Record Not Found!{W}')
Expand Down

0 comments on commit 2074bbd

Please sign in to comment.