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 1
1
import requests
2
2
import sys
3
3
from colorama import Fore , Style , init
4
+ import urllib3
5
+ from requests .exceptions import Timeout , RequestException
4
6
5
7
# Initialize colorama for colorized output
6
8
init (autoreset = True )
7
9
10
+ # Suppress SSL warnings
11
+ urllib3 .disable_warnings (urllib3 .exceptions .InsecureRequestWarning )
12
+
8
13
# Function to check the status code of each subdomain
9
14
def check_subdomains (file_path ):
10
15
try :
@@ -15,7 +20,7 @@ def check_subdomains(file_path):
15
20
subdomain = subdomain .strip () # Removing newline characters
16
21
if subdomain : # If the line is not empty
17
22
try :
18
- response = requests .get (f"http://{ subdomain } " , timeout = 5 , verify = False )
23
+ response = requests .get (f"http://{ subdomain } " , timeout = 10 , verify = False )
19
24
status_code = response .status_code
20
25
21
26
if status_code == 200 :
@@ -27,9 +32,9 @@ def check_subdomains(file_path):
27
32
else :
28
33
print (f"{ Fore .WHITE } [{ status_code } ] - { subdomain } " )
29
34
30
- except requests . exceptions . Timeout :
35
+ except Timeout :
31
36
print (f"{ Fore .WHITE } [TIMEOUT] - { subdomain } " )
32
- except requests . exceptions . RequestException :
37
+ except RequestException as e :
33
38
print (f"{ Fore .WHITE } [CONNECTION ERROR] - { subdomain } " )
34
39
35
40
except FileNotFoundError :
You can’t perform that action at this time.
0 commit comments