Skip to content

Commit 3c584e4

Browse files
Use more lenient urllib3.util.parse_url
1 parent 9740144 commit 3c584e4

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

aikido_zen/helpers/try_parse_url.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""Helper function file"""
22

3-
from urllib.parse import urlparse
3+
from urllib3.util import parse_url
44

55

66
def try_parse_url(url):
77
"""Tries to parse the url using urlparse"""
88
try:
9-
parsed_url = urlparse(url)
9+
parsed_url = parse_url(url)
1010
if parsed_url.scheme and parsed_url.netloc:
1111
return parsed_url
1212
return None

aikido_zen/vulnerabilities/ssrf/find_hostname_in_userinput.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def find_hostname_in_userinput(user_input, hostname_options: List[str], port=Non
3030
for variant in variants:
3131
user_input_url = try_parse_url(variant)
3232
if user_input_url and user_input_url.hostname in hostname_options:
33-
user_port = get_port_from_url(user_input_url.geturl())
33+
user_port = get_port_from_url(user_input_url.url)
3434

3535
# We were unable to retrieve the port from the URL, likely because it contains an invalid port.
3636
# Let's assume we have found the hostname in the user input, even though it doesn't match on port.

0 commit comments

Comments
 (0)