Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonked2 authored Jun 30, 2023
1 parent d605ff9 commit 93200b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions egy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import logging
import tqdm

ALLOWED_HOSTS = ["www.google.com"]

# Configure logging
logging.basicConfig(level=logging.INFO, format="%(levelname)s - %(message)s")

Expand Down Expand Up @@ -74,9 +76,9 @@ def check_open_redirect(url):
sanitized_url = urljoin(url, payload)
parsed_url = urlparse(sanitized_url)

if parsed_url.netloc == "www.google.com":
if parsed_url.netloc in ALLOWED_HOSTS:
response = requests.get(sanitized_url)
if response.status_code == 200 and "google.com" in response.url:
if response.status_code == 200 and urlparse(response.url).netloc == "www.google.com":
return True

return False
Expand Down

0 comments on commit 93200b8

Please sign in to comment.