-
Notifications
You must be signed in to change notification settings - Fork 1
/
Admin-Finder.py
321 lines (301 loc) · 14.6 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# Script feito por: Nano
# Telegram: https://t.me/rdzin9
import os
import sys
import re
import requests
import datetime
import pathlib
import threading
from time import sleep
from BanerAdm import BanerAdm
def LimparTela():
global system
system = sys.platform
match system:
case "win32":
os.system("cls")
case "linux":
os.system("clear")
def ValidEnter(msg=None):
# validar = re.search(r"^(http://|https://){1}(www\.)?([a-zA-Z0-9\-\_])+.+(\.com/|\.br/|\.ch/|\.edu/|\.su/|\.sp/|\.mg/|\.gov/|\.eu/|\.me||\.io/|\.pt/|\.tv/|\.uk/|\.ga/|\.ac/|\.mk/|\.co/|\.id/|\.net/|\.uk/|\.jp/|\.in/|\.vn/|\.tr/|\.tw/|\.info/|\.pk/|\.ng/|\.my/|\.sy/|\.bd/|\.cn/|\.gh/|\.se/|\.cyb|\.bbs/|\.geek/|\.chan/|\.vc/|\.pirate/|\.libre/|\.neo/|\.parody/|\.org/)(/)$", msg, flags=re.IGNORECASE)
validar = re.search(r"^(http://|https://){1}.+(\/)$",msg,flags=re.IGNORECASE)
if validar != None:
return True
else:
return False
def ValidWay(way=None):
way_valid = re.search(r"^((C:\\|/)?)([a-zA-Z0-9])+(\\|/){1}[a-zA-Z0-9]+(\\|/){1}([a-zA-Z0-9])+(\\|/){1}([a-zA-Z0-9])+(\\|/){1}([a-zA-Z0-9])+\.(txt)$", way)
if way_valid != None:
return True
else:
return False
Persist = requests.Session()
while True:
BanerAdm()
try:
site = str(input("\033[1;32m[+]\033[m \033[1;3mInforme o site alvo:\033[m "))
except KeyboardInterrupt:
raise SystemExit
else:
name_pasta = site.split("/")
os.makedirs(name_pasta[2],exist_ok=True)
if sys.platform == "win32":
caminho_save_win = str(os.getcwd())+str(r"\\"+name_pasta[2])+r"\\Found.txt"
else:
caminho_save_lin = str(os.getcwd())+str("/"+name_pasta[2])+"/Found.txt"
match = False
Found = False
options = [
"Y",
"N",
None
]
headers = {
'user-agent': 'Googlebot'
'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) '
'Chrome/55.0.2883.87 Safari/537.36'
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
'AppleWebKit/537.36 (KHTML, like Gecko) '
'Chrome/51.0.2704.103 Safari/537.36'
'Mozilla/5.0 (Windows NT 6.1) '
'AppleWebKit/537.36 (KHTML, like Gecko) '
'Chrome/55.0.2883.87 Safari/537.36'
'Mozilla/5.0 (Windows NT 6.1; rv:45.0)'
'Gecko/20100101 Firefox/45.0'
}
verify = ValidEnter(msg=site)
if not verify:
print("\033[1;31m[!]\033[m \033[1mVerifique se a url digitada está correta! E não esqueça de adicionar -> / no final da url!\033[m\n")
sleep(2)
else:
try:
site_teste = Persist.get(site,timeout=60,headers=headers)
except requests.ConnectionError:
print("\033[1;31m[!]\033[m \033[1mO Site não está disponível!\033[m\n")
sys.exit()
except KeyboardInterrupt:
print("\033[1;31m[!]\033[m \033[1mSaindo...!\033[m\n")
sleep(0.5)
sys.exit()
else:
if site_teste.status_code == 200:
BanerAdm()
print("""
\033[1;32m[\033[m \033[1;33m1\033[m \033[1;32m]\033[m \033[1;3m- Usar Wordlist normal\033[m
\033[1;32m[\033[m \033[1;33m2\033[m \033[1;32m]\033[m \033[1;3m- Usar Wordlist para Sublinks\033[m
""")
try:
choices = str(input("\033[132mset\033[m> ")).strip()
except KeyboardInterrupt:
raise SystemExit
else:
if choices == "1":
BanerAdm()
size = open("admin.txt","r")
wordlist_size = len(size.readlines())
print("\n\033[1;36m[*]\033[m \033[1;32mWordlist carregada com\033[m \033[1;33m{}\033[m \033[1;32mtentativas!\033[m".format(wordlist_size))
sleep(1)
print("\033[1;36m[*] \033[m\033[1;32mIniciado as\033[m \033[1;33m{}\033[m\n".format(datetime.datetime.now().strftime("%H:%M:%S")))
start = datetime.datetime.now()
with open("admin.txt","r") as page:
for pages in page:
admin_page = pages.replace("\n","")
testar = site+admin_page.strip()
try:
conectar = Persist.get(testar,timeout=5,headers=headers)
except KeyboardInterrupt:
print("[×] Saindo...")
sleep(0.5)
sys.exit()
except requests.ConnectionError:
continue
except requests.exceptions.InvalidURL:
continue
else:
if conectar.status_code == 200:
finish = datetime.datetime.now() - start
result = str(finish)
match = True
print("\033[1;35m-----------------------------\033[m")
print("\033[1m[\033[m\033[1;32mINFO\033[m\033[1m]\033[m \033[1m[\033[m\033[1;32m+\033[m\033[1m]\033[m \033[1;36mSITE:\033[m \033[1m{}\033[m".format(site))
print("\033[1m[\033[m\033[1;32mINFO\033[m\033[1m]\033[m \033[1m[\033[m\033[1;32m+\033[m\033[1m]\033[m \033[1;36mAdmin Page:\033[m \033[1m{}\033[m".format(testar))
print("\033[1;35m-----------------------------\033[m")
if sys.platform == "win32":
with open(caminho_save_win,"a") as save1:
save1.write("-----------------\n")
save1.write("SITE: {}\n".format(site))
save1.write("Página de Adm: {}\n".format(testar))
save1.write("Tempo que levei para encontrar: {}\n".format(result))
save1.write("-----------------\n")
save1.close()
else:
with open(caminho_save_lin,"a") as save1:
save1.write("-----------------\n")
save1.write("SITE: {}\n".format(site))
save1.write("Página de Adm: {}\n".format(testar))
save1.write("Tempo que levei para encontrar: {}\n".format(result))
save1.write("-----------------\n")
save1.close()
elif conectar.status_code == 401:
finish = datetime.datetime.now() - start
result = str(finish)
match = True
print("\033[1;35m-----------------------------\033[m")
print("\033[1m[\033[m\033[1;32mINFO\033[m\033[1m]\033[m \033[1m[\033[m\033[1;32m+\033[m\033[1m]\033[m \033[1;36mSITE:\033[m \033[1m{}\033[m".format(site))
print("\033[1m[\033[m\033[1;32mINFO\033[m\033[1m]\033[m \033[1m[\033[m\033[1;32m+\033[m\033[1m]\033[m \033[1;36mAdmin Page-Js:\033[m \033[1m{}\033[m".format(testar))
print("\033[1;35m-----------------------------\033[m")
if sys.platform == "win32":
with open(caminho_save_win,"a") as save1:
save1.write("-----------------\n")
save1.write("SITE: {}\n".format(site))
save1.write("Página de Adm-Js: {}\n".format(testar))
save1.write("Tempo que levei para encontrar: {}\n".format(result))
save1.write("-----------------\n")
save1.close()
else:
with open(caminho_save_lin,"a") as save1:
save1.write("-----------------\n")
save1.write("SITE: {}\n".format(site))
save1.write("Página de Adm-Js: {}\n".format(testar))
save1.write("Tempo que levei para encontrar: {}\n".format(result))
save1.write("-----------------\n")
save1.close()
else:
print("\033[1m[\033[m\033[36m{}\033[m\033[1m]\033[m \033[1m[\033[m\033[1;31m{}\033[m\033[1m]\033[m\033[m \033[1;32;3mTesting:\033[m \033[3;2m{}\033[m \033[1m[-]\033[m \033[1;31mError\033[m \033[1m[-]\033[m".format(datetime.datetime.now().strftime("%H:%M:%S"),conectar.status_code,testar))
page.close()
elif choices == "2":
try:
sleep(0.6)
BanerAdm()
print("\033[1;33m[{}]\033[m\033[1;32m [*]\033[m \033[1mAbrindo Wordlist de sublinks...\033[m\n".format(datetime.datetime.now().strftime("%H:%M:%S")))
sleep(2)
caminho_wordlist_2 = os.getcwd()
resultado = False
proxies = {"27.54.71.234":"8080"}
size_subs1 = open("Subdominios.txt","r").readlines()
print("\033[1;32m[*]\033[m\033[1;32m Wordlist carregada com: \033[m\033[1;33m{}\033[m\033[1;32m tentativas!\033[m".format(len(size_subs1)))
print("\033[1;32m[*]\033[m\033[1m CTRL+C PARA PARAR O SCRIPT!\033[m\n")
sleep(2)
except KeyboardInterrupt:
raise SystemExit
for file in os.listdir(str(caminho_wordlist_2)):
if file == "Subdominios.txt":
with open(file,"r") as wordlist_2:
for subdominio in wordlist_2:
if "www." in site:
site_2 = site.replace("www.","")
subd = subdominio.replace("\n","")
mudar = site_2.split("//")
resultado = mudar[0]+"//"+subd+"."+mudar[1]
try:
conectar3 = Persist.get(resultado,headers=headers)
except KeyboardInterrupt:
raise SystemExit
except requests.exceptions.ConnectionError:
print("\033[1;32m[{}]\033[m\033[1;31m [403]\033[m\033[1m Site:\033[m \033[1;36m{}\033[m | \033[1mStatus:\033[m \033[1;31mError!\033[m".format(datetime.datetime.now().strftime("%H:%M:%S"),resultado))
except requests.exceptions.InvalidURL:
continue
else:
if conectar3.status_code == 200:
if "www." not in resultado:
if "m." not in resultado:
print("\n\033[1;33m-----------------------------\033[m")
print("\033[1;36m[INFO]\033[m \033[1;32mSITE:\033[m \033[1m{}\033[m".format(site))
print("\033[1;36m[INFO]\033[m \033[1;32mPossível Admin page:\033[m \033[1m{}\033[m".format(resultado))
print("-----------------------------\033[m\n")
if sys.platform == "win32":
with open(caminho_save_win,"a") as save2:
save2.write("-----------------\n")
save2.write("SITE: {}\n".format(site))
save2.write("Página de Adm: {}\n".format(resultado))
save2.write("-----------------\n")
save2.close()
elif sys.platform == "linux":
with open(caminho_save_lin,"a") as save2:
save2.write("-----------------\n")
save2.write("SITE: {}\n".format(site))
save2.write("Página de Adm: {}\n".format(resultado))
save2.write("-----------------\n")
save2.close()
elif conectar3.status_code == 401:
if "www." not in resultado:
if "m." not in resultado:
print("\n\033[1;33m-----------------------------\033[m")
print("\033[1;36m[INFO]\033[m \033[1;32mSITE:\033[m \033[1m{}\033[m".format(site))
print("\033[1;36m[INFO]\033[m \033[1;32mPossível Admin page-Js:\033[m \033[1m{}\033[m".format(resultado))
print("-----------------------------\033[m\n")
if sys.platform == "win32":
with open(caminho_save_win,"a") as save2:
save2.write("-----------------\n")
save2.write("SITE: {}\n".format(site))
save2.write("Página de Adm-Js: {}\n".format(resultado))
save2.write("-----------------\n")
save2.close()
elif sys.platform == "linux":
with open(caminho_save_lin,"a") as save2:
save2.write("-----------------\n")
save2.write("SITE: {}\n".format(site))
save2.write("Página de Adm-Js: {}\n".format(resultado))
save2.write("-----------------\n")
save2.close()
else:
subd = subdominio.replace("\n","")
mudar = site.split("//")
resultado2 = mudar[0]+"//"+subd+"."+mudar[1]
try:
conectar4 = Persist.get(resultado2,proxies=proxies)
except requests.exceptions.ConnectionError:
print("\033[1;32m[{}]\033[m\033[1;31m [403]\033[m\033[1m Site:\033[m \033[1;36m{}\033[m | \033[1mStatus:\033[m \033[1;31mError!\033[m".format(datetime.datetime.now().strftime("%H:%M:%S"),resultado2))
except requests.exceptions.InvalidURL:
continue
else:
if conectar4.status_code == 200:
if "www." not in resultado2:
if "m." not in resultado2:
print("\n\033[1;33m-----------------------------\033[m")
print("\033[1;36m[INFO]\033[m \033[1;32mSITE:\033[m \033[1m{}\033[m".format(site))
print("\033[1;36m[INFO]\033[m \033[1;32mPossível Admin page:\033[m \033[1m{}\033[m".format(resultado2))
print("-----------------------------\033[m\n")
if sys.platform == "win32":
with open(caminho_save_win,"a") as save3:
save3.write("-----------------\n")
save3.write("SITE: {}\n".format(site))
save3.write("Página de Adm: {}\n".format(resultado2))
save3.write("-----------------\n")
save3.close()
elif sys.platform == "linux":
with open(caminho_save_win,"a") as save3:
save3.write("-----------------\n")
save3.write("SITE: {}\n".format(site))
save3.write("Página de Adm: {}\n".format(resultado2))
save3.write("-----------------\n")
save3.close()
elif conectar4.status_code == 401:
if "www." not in resultado2:
if "m." not in resultado2:
print("\n\033[1;33m-----------------------------\033[m")
print("\033[1;36m[INFO]\033[m \033[1;32mSITE:\033[m \033[1m{}\033[m".format(site))
print("\033[1;36m[INFO]\033[m \033[1;32mPossível Admin page:\033[m \033[1m{}\033[m".format(resultado2))
print("-----------------------------\033[m\n")
if sys.platform == "win32":
with open(caminho_save_win,"a") as save3:
save3.write("-----------------\n")
save3.write("SITE: {}\n".format(site))
save3.write("Página de Adm: {}\n".format(resultado2))
save3.write("-----------------\n")
save3.close()
elif sys.platform == "linux":
with open(caminho_save_win,"a") as save3:
save3.write("-----------------\n")
save3.write("SITE: {}\n".format(site))
save3.write("Página de Adm: {}\n".format(resultado2))
save3.write("-----------------\n")
save3.close()
wordlist_2.close()
print("\n\033[1mRetornando ao menu...\033[m")
sleep(2)
else:
print("\033[1;31m[!]\033[m\033[1m Não foi possível estabelecer uma conexão com o site alvo...\033[m")
print("\033[1;31m[!]\033[m\033[1m Retornando ao menu...\033[m")
sleep(1.4)