File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff 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
2126if __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 ])
You can’t perform that action at this time.
0 commit comments