Skip to content

Commit 2c09e58

Browse files
committed
Cleanup inspect_getaddrinfo_result code
1 parent f458611 commit 2c09e58

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

aikido_zen/vulnerabilities/ssrf/inspect_getaddrinfo_result.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616
# gets called when the result of the DNS resolution has come in
1717
def inspect_getaddrinfo_result(dns_results, hostname, port):
1818
"""Inspect the results of a getaddrinfo() call"""
19-
if not hostname or try_parse_url(hostname) is not None:
20-
# If we cannot parse the hostname, there's no reason to continue with the scan.
21-
logger.debug("Hostname %s invalid, not running scans", hostname)
22-
return
19+
if not hostname or not dns_results:
20+
return # Ensure that the data we get isnt empty
2321

2422
ip_addresses = extract_ip_array_from_results(dns_results)
2523
imds_ip = resolves_to_imds_ip(ip_addresses, hostname)

0 commit comments

Comments
 (0)