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 ip-address parsing for IPv6 addresses #1670

Merged
merged 1 commit into from
Feb 24, 2024
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
6 changes: 3 additions & 3 deletions theHarvester/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ async def handler(lst):
for host in full:
if ":" in host:
# TODO parse addresses and sort them as they are IPs
subdomain, addr = host.split(":")
subdomain, addr = host.split(":", 1)
if subdomain.endswith(word):
temp.add(subdomain + ":" + addr)
continue
Expand All @@ -1075,7 +1075,7 @@ async def handler(lst):
print(host)
try:
if ":" in host:
_, addr = host.split(":")
_, addr = host.split(":", 1)
await db.store(word, addr, "ip", "DNS-resolver")
except Exception as e:
print(
Expand Down Expand Up @@ -1107,7 +1107,7 @@ async def handler(lst):
for host in resolved_pair:
if ":" in host:
# TODO parse addresses and sort them as they are IPs
subdomain, addr = host.split(":")
subdomain, addr = host.split(":", 1)
if subdomain.endswith(word):
# Append to full, so it's within JSON/XML at the end if output file is requested
if host not in full:
Expand Down