-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin-finder.py
97 lines (83 loc) · 2.48 KB
/
admin-finder.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import requests
import sys
import validators
#check validation url
def check_url(url):
check = validators.url(url)
if check == True:
return(True)
else:
return(False)
def path_list():
list_path = []
fresh_list = []
with open("src/path_login.txt") as file_path:
list_path = file_path.readlines()
for i in list_path:
fresh_list.append(i[:-1])
return fresh_list
# check response content word
def check_content(content):
check_list = [
"username",
"password",
"Username",
"Password",
"email",
"mail",
"number",
"ID",
"user",
"pass",
]
for c in check_list:
if c.upper() in content or c.lower() in content or c in content:
return(True)
def about():
banner = """
++++++++++++++++++++++++++++++++++++
# Coded By Shadow Hunters
# version -----> 0.1
++++++++++++++++++++++++++++++++++++
"""
print(banner)
def help():
banner = """
========================================
Usage :
python admin-finder.py https://target.com
========================================
"""
print(banner)
if __name__ == "__main__":
checked_list = []
try:
var = sys.argv[1]
if "-h" in var or "--help" in var:
help()
elif check_url(var) == True:
list_path = path_list()
for l in list_path:
# Merge root site to path
url = var +"/"+l
try:
r = requests.get(url=url)
status_code = r.status_code
print(f"[*] {url} : {status_code}")
#check response
if (status_code == 200 or status_code == 302 or status_code == 403 or status_code == 401 or status_code == 404) and (check_content(str(r.content)) == True):
checked_list.append(url)
except requests.exceptions.ConnectionError:
print("[!] ERROR IN CONNECTION URL....")
count = len(checked_list)
print(f"[~~] {count} Results Detected")
n = 0
if count > 0:
for t in checked_list:
n+=1
print(f"{n} ---> {t}")
elif check_url(var) == False:
print("[#] Invalid Url! Please check Url.")
except IndexError:
about()
help()