dirbuster_threaded.py 文件源码

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

项目:Python4Pentesters 作者: tatanus 项目源码 文件源码
def test_dir(url, depth, max_depth, dir_list):
    if (depth > max_depth):
        return
    depth = depth +1

    for d in dir_list:
        new_url = url + "/" + d
        try:
            # make a SSL handler that ignores SSL CERT issues
            ctx = ssl.create_default_context()
            ctx.check_hostname = False
            ctx.verify_mode = ssl.CERT_NONE

            response = urllib2.urlopen(new_url, context=ctx)
            if response and response.getcode() == 200:
                print "[+] FOUND %s" % (new_url)
                thread.start_new_thread(test_dir, (new_url, depth, max_depth, dir_list, ))
        except urllib2.HTTPError, e:
            if e.code == 401:
                print "[!] Authorization Required %s " % (new_url)
            elif e.code == 403:
                print "[!] Forbidden %s " % (new_url)
            elif e.code == 404:
                print "[-] Not Found %s " % (new_url)
            elif e.code == 503:
                print "[!] Service Unavailable %s " % (new_url)
            else:
                print "[?] Unknwon"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号