-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvuln-checker.py
69 lines (63 loc) · 1.97 KB
/
vuln-checker.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
__author__ = 'Recep Gunes'
import requests, sys
def file_open(file_name):
list = []
file = open(file_name,"r")
file_in = file.readlines()
for value in file_in:
if value not in " ":
list.append(value.replace("\n", ""))
else:
pass
file.close()
return list
def checker(vuln_list):
error_list = file_open("error.conf")
sites = []
value = False
for vuln in vuln_list:
sites.append(vuln+"'")
for site in sites:
try:
request = requests.get(url=site.encode("UTF-8"))
source_code = str(request.content)
for error in error_list:
if error in source_code:
value = True
break
elif error not in source_code:
value = False
continue
if value == True:
print("[+] {} ----> Vuln Found.".format(site))
elif value == False:
print("[-] {} ----> Vuln Not Found.".format(site))
except requests.ConnectionError:
print("[!] {} ----> Connection Error!".format(site))
print("{}".format("=" * 75))
def banner():
banner = """{}
\t ___ ___ _ _ __ __ _
\t / __|/ _ \| | (_) \ \ / / _| |_ _
\t \__ \ (_) | |__| | \ V / || | | ' \ _
\t |___/\__\_\____|_|_ \_/ \_,_|_|_||_(_)
\t / __| |_ ___ __| |_____ _ _
\t | (__| ' \/ -_) _| / / -_) '_|
\t \___|_||_\___\__|_\_\___|_|
\t How To Use: \n \t python3 vuln-checker.py [target_list]
{}""".format("="*75, "="*75)
return banner
if __name__ == "__main__":
try:
print(banner())
target_file = file_open(sys.argv[1])
checker(target_file)
sys.exit()
except IndexError:
print("Please Entry A Target File Name.\n")
sys.exit()
except KeyboardInterrupt:
print("Good Bye :)\n")
sys.exit()