File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11import requests
22import sys
33from colorama import Fore , Style , init
4+ import urllib3
5+ from requests .exceptions import Timeout , RequestException
46
57# Initialize colorama for colorized output
68init (autoreset = True )
79
10+ # Suppress SSL warnings
11+ urllib3 .disable_warnings (urllib3 .exceptions .InsecureRequestWarning )
12+
813# Function to check the status code of each subdomain
914def check_subdomains (file_path ):
1015 try :
@@ -15,7 +20,7 @@ def check_subdomains(file_path):
1520 subdomain = subdomain .strip () # Removing newline characters
1621 if subdomain : # If the line is not empty
1722 try :
18- response = requests .get (f"http://{ subdomain } " , timeout = 5 , verify = False )
23+ response = requests .get (f"http://{ subdomain } " , timeout = 10 , verify = False )
1924 status_code = response .status_code
2025
2126 if status_code == 200 :
@@ -27,9 +32,9 @@ def check_subdomains(file_path):
2732 else :
2833 print (f"{ Fore .WHITE } [{ status_code } ] - { subdomain } " )
2934
30- except requests . exceptions . Timeout :
35+ except Timeout :
3136 print (f"{ Fore .WHITE } [TIMEOUT] - { subdomain } " )
32- except requests . exceptions . RequestException :
37+ except RequestException as e :
3338 print (f"{ Fore .WHITE } [CONNECTION ERROR] - { subdomain } " )
3439
3540 except FileNotFoundError :
You can’t perform that action at this time.
0 commit comments