• 小工具-一级目录枚举


    一级目录枚举

    代码

    """
    跑一级目录
    字典每行开头带/
    """
    
    import requests
    import re
    
    def req(res):
        url = input("Target:
    ")
        print("WebPathBrute Start!
    ")
        headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36','Connection':'close'}
        for i in res:
            r = requests.get(url+i,headers=headers) #字典里有/所以此处不加,没有要加上/
            requests.adapters.DEFAULT_RETRIES=2
            if r.status_code == 200:
                # if re.search('网站自定义404页面特征',r.text):
                # pass
                # else:
                # print(url+i)
                print(url+i)
            else:
                pass
    def dic():
        lie = []
        path = input("Dictionary:
    ")
        with open(path,encoding='UTF-8') as f:
            for line in f.readlines():
                line = line.strip()
                lie.append(line)
        return lie
    
    if __name__ == "__main__":
        dic = dic()
        req(dic)
    
    
  • 相关阅读:
    阅读《构建之法》1-5章
    构建之法第8,9,10章
    实验5-封装与测试2
    第六次作业-my Backlog
    保存内容
    实验四-单元测试
    实验3—修改版
    做汉堡-57号
    实验3-2
    201306114357-实验3-C语言
  • 原文地址:https://www.cnblogs.com/Rain99-/p/12910599.html
Copyright © 2020-2023  润新知