-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponsor.py
36 lines (29 loc) · 1.01 KB
/
responsor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!usr/bin/python3
# [desc]: displays response codes of websites in given list
# [dev] : A Divinemonk creation!
import requests as r
import sys
print("\n \33[7;90;97m [ R3SP0NS0R ] (ctrl-z to exit) \033[0m\n")
try:
with open (sys.argv[1], 'r') as urls:
# url should we without `http://` or `https://`
url = urls.read().split('\n')
# requesting each url and displays their response code
for u in url:
try:
status_code = r.get('https://'+u, timeout=10).status_code
except:
continue
if status_code == 200:
print ('\33[1;49;92m [',status_code, ']:',u)
elif status_code == 403:
print ('\33[1;49;93m [',status_code, ']:',u)
else:
print ('\33[1;49;91m [',status_code, ']:',u)
# scan complete message
print ('\n \033[0m\33[7;90;97m [ Aye aye, happy hacking captain :) ] \033[0m\n')
# handling errors
except IndexError:
print (' [!] File name missing\n [i] usage: \'python responsor.py URL_LIST.txt\'\n')
except FileNotFoundError:
print (f' [!] File \'{sys.argv[1]}\' not found\n')