Skip to content

Commit 0b94d3c

Browse files
authored
Update check_http.py
1 parent 83125e9 commit 0b94d3c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

check_http.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,20 @@ def check_subdomains(file_path):
1111
subdomain = subdomain.strip() # Removing newline characters
1212
if subdomain: # If the line is not empty
1313
try:
14-
response = requests.get(f"http://{subdomain}")
14+
# Adding timeout and disabling SSL verification
15+
response = requests.get(f"http://{subdomain}", timeout=5, verify=False)
1516
print(f"[{response.status_code}] - {subdomain}")
17+
except requests.exceptions.SSLError as ssl_err:
18+
print(f"[SSL ERROR] - {subdomain} ({ssl_err})")
19+
except requests.exceptions.Timeout as timeout_err:
20+
print(f"[TIMEOUT] - {subdomain} ({timeout_err})")
1621
except requests.exceptions.RequestException as e:
1722
print(f"[ERROR] - {subdomain} ({e})")
1823
except FileNotFoundError:
1924
print(f"File '{file_path}' not found.")
2025

2126
if __name__ == "__main__":
2227
if len(sys.argv) != 3:
23-
print("Usage: python http.py -l <subdomains.txt>")
28+
print("Usage: python check_http.py -l <subdomains.txt>")
2429
elif sys.argv[1] == "-l":
2530
check_subdomains(sys.argv[2])

0 commit comments

Comments
 (0)