dirsearch用法大全

dirsearch

扫描的目标

-u,--url                    目标url
-l,--url-list=FILE          目标url文件路径 
--stdin                     从标准输入中指定url
--cidr                      目标网段
--raw=File                  从文件中读取request报文,通过-schema指定策略(如--schema https)

扫描的字典类型

-e,--extensions             包含的文件拓展名(逗号分隔)  如-e php,asp  
-X,--exclude-extensions     排除的文件拓展名(逗号分隔)  如-X asp,jsp
-f,--force-extensions       在字典的每条记录后面添加文件拓展名

dirsearch默认只会替换字典中%EXT%为指定的extensions 
如-e php  Wishlist.%EXT%-->Wishlist.php

字典格式设置

-w,--wordlists              自定义wordlist(以逗号分隔)
--prefixes                  添加自定义前缀
--suffixes			        添加自定义后缀
--only-selected      	    筛选出指定的文件拓展名或无文件拓展名的目录
--remove-extensions   	    移除所有wordlist的后缀名 (admin.php --> admin)
-U, --uppercase      	    将字典转换为大写
-L, --lowercase		 	    将字典转换为小写
-C, --capital        	    第一个字母大写剩下字母小写

响应结果的过滤

-i                    		保留的响应状态码(以逗号分隔,支持指定范围)(-i 200,300-399)
-x                    		排除的响应状态码(以逗号分隔,支持指定范围)(-x 301,500-599)
--exclude-sizes             通过大小排除(以逗号分隔)(123B,4KB)
--exclude-texts     		通过文本内容排除响应('Not found', 'Error')
--exclude-regexps  			通过正则匹配排除响应('Not foun[a-z]{1}', '^Error$')
--exclude-redirects 		通过正则跳转目标排除响应('https://okta.com/*')
--minimal 					最小响应报文长度
--maximal 					最大响应报文长度

请求相关设置

-m,--http-method    	    HTTP请求方法 默认为GET
-d,--data   				HTTP请求数据
-H,--header  				请求头 如(-H 'Referer: example.com' -H 'Accept: */*')
--header-list=FILE  		从文件中读取请求头
-F,--follow-redirects  	    跟随HTTP跳转
--user-agent  			    设置user-agent字段
--cookie  				 	设置cookie

连接相关设置

--timeout=TIMEOUT     		连接超时时间
--ip=IP   					服务器ip地址
-s DELAY, --delay=DELAY     每次请求间隔的时间
--proxy=PROXY   			代理url 支持HTTP和SOCKS代理 如(localhost:8080, socks5://localhost:8088)
--proxy-list=FILE 		    包含代理服务器的地址
--matches-proxy=PROXY       Proxy to replay with found paths
--scheme   					默认的策略 用于从文件中导入请求或url中不包含协议
--max-retries 			    最大重连次数
-b,--request-by-hostname 	强制通过域名连接,(默认为了速度,使用ip连接)
--exit-on-error    		    出现错误时退出
--debug					    Debug模式

通用设置

--version  显示dirsearch的版本
-h --help   帮助提示
-r,--recursive        	    递归爆破
-R,--recursion-depth  		最大递归的层数
-t,--threads         		线程数
--subdirs             		扫描子目录 如(admin/ 则www.example.com/admin/+字典)
--exclude-subdirs     		在递归扫描中排除的子目录
-q,--quiet-mode             安静模式
--full-url                  打印出完整的url
--no-color                  无颜色输出信息

输出模式

--simple-report=OUTPUTFILE
--plain-text-report=OUTPUTFILE
--json-report=OUTPUTFILE
--xml-report=OUTPUTFILE
--markdown-report=OUTPUTFILE
--csv-report=OUTPUTFILE

可以通过修改default.conf文件去修改dirsearch的默认配置(默认文件拓展名,超时时间,wordlist所在目录等)

常见的用法

简单用法
采用默认设置扫描目标url
python3 dirsearch.py -u https://target
使用文件拓展名为php,html,js的字典扫描目标url
python3 dirsearch.py -e php,html,js -u https://target
采用指定路径的wordlist且拓展名为php,html,js的字典扫描目标url
python3 dirsearch.py -e php,html,js -u https://target -w /path/to/wordlist
递归扫描
python3 dirsearch.py -e php,html,js -u https://target -r
设置递归层数为3
python3 dirsearch.py -e php,html,js -u https://target -r -R 3
指定线程(不建议线程数调整过大,可能会影响扫描的结果)
python3 dirsearch.py -e bak,zip,tgz,txt -u https://target -t 30
使用前缀后缀
python3 dirsearch.py -e php -u https://target --prefixes .,admin,_,~(前缀)

tools

变为

.tools
admintools
_tools
~tools

python3 dirsearch.py -e php -u https://target --suffixes ~,/(后缀)

index.php
internal

变为

index.php~
index.php/
internal~
internal/

对文件拓展名的限制
python3 dirsearch.py -e asp,aspx,htm,js -u https://target -X php,jsp,jspx

admin
admin.%EXT%
index.html
home.php
test.jsp

变为

admin
admin.asp
admin.aspx
admin.htm
admin.js
index.html

从文件中导入http请求的用法
请求格式

GET /admin HTTP/1.1
Host: admin.example.com
Cache-Control: max-age=0
Accept: */*

通过–schema指定策略 默认为http
子目录
python3 dirsearch.py -e php,html,js -u https://target --subdirs admin/,folder/,/
使用代理
python3 dirsearch.py -e php,html,js -u https://target --proxy 127.0.0.1:8080
使用代理集合
python3 dirsearch.py -e php,html,js -u https://target --proxylist proxyservers.txt
POST请求
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt -t 100 -m POST --data "username=admin"

TIPS

控制每秒请求的速率:-t <rate> -s 1
寻找备份文件和配置文件:--suffixes ~--prefixes .
取消强制文件拓展名:添加%NOFORCE%
只想找到寻找文件夹和目录:--no-extension+--suffixes /
对于网段爆破时采用:--cidr+-F+-q(跟随跳转+安静模式)减少无效结果

  • 57
    点赞
  • 313
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
dirsearch是一个用于扫描目标URL的工具,可以用来查找目标网站中存在的目录和文件。以下是一些dirsearch用法示例: 1. 简单用法:使用默认设置扫描目标URL `python3 dirsearch.py -u https://target` \[1\] 2. 使用指定的文件拓展名字典扫描目标URL `python3 dirsearch.py -e php,html,js -u https://target` \[1\] 3. 使用指定路径的wordlist且拓展名为php,html,js的字典扫描目标URL `python3 dirsearch.py -e php,html,js -u https://target -w /path/to/wordlist` \[1\] 4. 递归扫描目标URL `python3 dirsearch.py -e php,html,js -u https://target -r` \[1\] 5. 设置递归层数为3 `python3 dirsearch.py -e php,html,js -u https://target -r -R 3` \[1\] 6. 指定线程数(不建议线程数调整过大,可能会影响扫描结果) `python3 dirsearch.py -e bak,zip,tgz,txt -u https://target -t 30` \[1\] 7. 使用前缀后缀 `python3 dirsearch.py -e php -u https://target --prefixes .,admin,_,~(前缀) tools` \[1\] 8. 引用\[2\]中的示例: `python3 dirsearch.py -u http://192.168.52.143 -e * -w /root/dirsearch/db/dicc.txt --prefixes=2222 -f %a% --no-dot-extensions -U` \[2\] 请注意,使用dirsearch时需要遵守相关法律法规,切勿用于非法犯罪活动。对于恶意使用该工具造成的损失,与工具的开发者无关。\[3\] #### 引用[.reference_title] - *1* [dirsearch用法大全](https://blog.csdn.net/qq_43936524/article/details/115271837)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [dirsearch的使用](https://blog.csdn.net/Amdy_amdy/article/details/109522882)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [dirsearch使用教程](https://blog.csdn.net/m0_48574718/article/details/129244162)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值