工欲善其事,必先利其器。最近需要挖漏洞,赶紧掏出82年的目录扫描工具准备。
dirsearch是一个扫描网站的目录和文件的命令行工具,并可以使用多线程快速扫描目标站点。它可以通过自定义字典进行扫描,同时支持正则表达式和自定义扩展名。dirsearch是一个基于Python的工具,它的代码开源,使用简单且易于扩展。这是目前个人觉得最好的目录扫描工具,不接受反驳,反驳就是你对。
一、安装及配置
1)下载dirsearch-master.zip文件
下载地址:https://github.com/maurosoria/dirsearch
2)安装dirsearch所需要的依赖
dirsearch运行报错Failed to install dirsearch dependencies, try doing it manually
解决方法:
Linux:sudo apt-get install python3-pip
windows可执行:pip3 install -r requirements.txt
或者(可以都试试)
pip3 install -r requirements.txt -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
或者(可以都试试,以前使用上面两个都可以,现在使用下面这个很快就安装好)
pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
注:requirements.txt文件在dirsearch-master目录里面,所以是进入dirsearch-master目录后执行的命令。
3)需要安装python3.7以上版本
dirsearch运行报错Sorry, dirsearch requires Python 3.7 or higher
我的是python3.6根本没资格使用dirsearch-master
解决方法:
直接下载最新的python安装,认证官网下载https://www.python.org/getit/
4)运行效果
二、使用策略扫描目录
注:dirsearch的目录字典不能在其他扫描工具里面使用。但其他字典可以在dirsearch使用,估计是dirsearch在调用字典时有一些策略。
1)使用自带全量字典扫描单个url的目录
python dirsearch.py -u http://222.93.xx.xx:8090 -e*
2)使用自带字典扫描单个url的目录
使用网上收集的Springboot-ActuatorExploit字典都扫描不出目录,但使用这个默认字典能扫描出/swagger-resources目录。
查看响应码为200(响应成功)的目录即可。
python dirsearch.py -u http://222.93.xx.xx:8090
3)使用指定字典扫描批量url的目录
使用指定字典扫描批量url的目录,保留状态码200
python d:\dirsearch-master\dirsearch.py -l D:\dirsearch-master\url\url.txt -w D:\dirsearch-master\db\01-Spring.txt -i 200
三、简单的使用方法
//默认方式扫描单个url
python3 dirsearch.py -u https://target
//使用文件拓展名为php和txt以及js的字典扫描目标
python3 dirsearch.py -e php,txt,js -u https://target
//采用指定路径的wordlist且拓展名为php,txt,js的字典扫描目标url
python3 dirsearch.py -e php,txt,js -u https://target -w /path/to/wordlist
//采用递归扫描
python3 dirsearch.py -e php,txt,js -u https://target -r
//采用递归扫描递归层数为三层
python3 dirsearch.py -e php,txt,js -u https://target -r -R 3
四、扫描结果记录位置
{dirsearch-master位置}\reports\
五、默认的字典位置
diresearch文件所在目录,进入db文件夹里面的dicc.txt就是默认的字典位置:
六、Dirsearch语法介绍
常用命令:
--version 显示dirsearch的版本
-h –help 帮助提示
-u --url 指定网址
-e 指定网站语言
-w 指定字典
-r 递归目录(跑出目录后,继续跑目录下面的目录)
-l --url-list=FILE 目标url文件路径
-i 保留的响应状态码(以逗号分隔,支持指定范围) 如(-i 200,300-399)
-x 排除的响应状态码(以逗号分隔,支持指定范围) 如(-x 301,500-599)
使用案例:
python d:\dirsearch-master\dirsearch.py -l D:\dirsearch-master\url\url.txt -w D:\dirsearch-master\db\01-http-or-https.txt -i 200
Taps:
1)扫描二维码点击关注,设为星标。 2)下载地址:文档下载公众号回复"dir2023"获取工具下载 免责声明:请勿利用文章内的相关技术从事非法测试。若因此产生一切后果与本公众号以及作者无关。 |