dirsearch安装:
git clone GitHub - maurosoria/dirsearch: Web path scanner
常见文件泄露类型
git,svn,hg,CVS,Bazaar,github,.DS_Store,
常见Payload
1.扫描单个URL,并限制线程数和扩展名:
python dirsearch.py -u Example Domain -t 10 -e php,asp --exclude-extensions=html
该命令将对 Example Domain 进行目录扫描,使用最多 10 个线程并仅检查扩展名为 php 和 asp 的路径,同时排除扩展名为 html 的路径。
2.从URL列表文件中批量扫描:
python dirsearch.py -l urls.txt -t 5 -e php
该命令将从 urls.txt 文件中读取目标URL列表,并使用最多 5 个线程对每个URL进行目录扫描,仅检查扩展名为 php 的路径。
3.使用自定义字典和深度递归扫描:
python dirsearch.py -u Example Domain -w custom-wordlist.txt -r --deep-recursive
该命令将对 Example Domain 进行目录扫描,使用自定义的单词列表文件 custom-wordlist.txt,并启用深度递归扫描,即在每个目录的所有深度上执行递归扫描。
4.在请求中使用自定义HTTP头:
python dirsearch.py -u Example Domain -H "X-Custom-Header: Value" -H "Authorization: Bearer token"
该命令将对 Example Domain 进行目录扫描,并在每个请求中包含自定义的HTTP头,如 X-Custom-Header 和 Authorization。
5.指定线程数和延迟时间:
python dirsearch.py -u Example Domain -t 20 --delay 0.5
上述命令将使用20个线程并设置每个请求之间的延迟为0.5秒。
6.使用自定义的请求头和超时时间:
python dirsearch.py -u Example Domain -H "Custom-Header: value" --timeout 10
这个命令将在每个请求中添加一个自定义的请求头 “Custom-Header: value”,并将超时时间设置为10秒。
7.包含和排除特定状态码:
python dirsearch.py -u Example Domain -i 200,302 -x 404,500
上述命令将只包含状态码为200和302的响应,并排除状态码为404和500的响应。
8.使用代理进行扫描:
python dirsearch.py -u Example Domain -p http://127.0.0.1:8080
这个命令将通过指定的HTTP代理(例如Burp Suite)对目标URL进行扫描。
9.保存输出到文件中:
python dirsearch.py -u Example Domain -o output.txt
上述命令将扫描结果输出到指定的文件 output.txt。
10.使用代理链进行扫描:
python dirsearch.py -u Example Domain -p http://proxy1:8080 -p http://proxy2:8080
上述命令将通过两个代理服务器 proxy1 和 proxy2 进行目标URL的扫描。
11.从标准输入读取URL:
cat urls.txt | python dirsearch.py --stdin -t 10
这个命令通过管道从 urls.txt 中读取URL,并使用最多 10 个线程对每个URL进行目录扫描。
12.启用递归扫描和重定向跟随:
python dirsearch.py -u Example Domain -r -F
上述命令将启用目录的递归扫描,并且在扫描时跟随HTTP重定向。
13.排除指定大小范围的响应:
python dirsearch.py -u Example Domain --exclude-sizes 0-100B,500KB-1MB
该命令将排除大小在 0 到 100 字节以及 500千字节到 1 兆字节范围内的响应。
14.设定最大运行时间和最大重试次数:
python dirsearch.py -u Example Domain --max-time 300 --retries 5
上述命令将设置最长运行时间为 300 秒,并允许失败请求最多重试 5 次。
15.指定自定义的User-Agent头:
python dirsearch.py -u Example Domain --user-agent "Custom User Agent"
上述命令将在HTTP请求中指定自定义的User-Agent头。
16.使用代理认证进行扫描:
python dirsearch.py -u Example Domain -p http://proxy.example.com --proxy-auth "username:password"
这个命令将使用指定的代理服务器 proxy.example.com 进行扫描,并提供代理认证的用户名和密码。
17.启用递归扫描并限制最大递归深度:
python dirsearch.py -u Example Domain -r -R 5
上述命令将启用递归目录扫描,并限制最大递归深度为5层。
18.排除特定文本出现的响应:
python dirsearch.py -u Example Domain --exclude-text "Not Found" --exclude-text "Error"
该命令将排除响应中包含指定文本(如 “Not Found” 和 “Error”)的路径。
19.设置最小和最大响应长度:
python dirsearch.py -u Example Domain --min-response-size 1000 --max-response-size 50000
上述命令将只包含响应长度在1000到50000字节之间的路径。