书店网站的建设做竞价网站要准备什么条件
文章目录
- 基本用法
 - 主要参数和选项
 - 目标和URL设置
 - --url URL
 - --url-list FILE
 
- 扩展名
 - --extensions EXTENSIONS
 
- 字典文件
 - --wordlists WORDLIST
 
- 线程和性能
 - --threads THREADS
 - --timeout SECONDS
 - --delay MILLISECONDS
 
- 忽略状态码
 - 代理和请求设置
 - --proxy PROXY
 - --headers HEADERS
 
- 保存结果
 - --output FILE
 
- 其他选项
 - --recursive
 - --recursive-depth DEPTH
 - --exclude-sizes SIZES
 - --exclude-text TEXT
 - --force-extensions
 - --full-url
 - --random-agent
 - -c FILE, --config FILE
 
- 完整命令示例
 - 查看帮助
 - 常用组合
 - 基本扫描
 - 使用特定扩展名和字典文件
 - 使用代理和自定义头
 - 保存结果并忽略状态码
 
- 总结
 
基本用法
python3 dirsearch.py -u URL
 
主要参数和选项
目标和URL设置
–url URL
指定目标 URL
-u http://example.com
 
–url-list FILE
从文件中读取多个 URL
-l urls.txt
 
扩展名
–extensions EXTENSIONS
逗号分隔的文件扩展名列表
-e php,html
 
字典文件
–wordlists WORDLIST
使用自定义字典文件
-w /path/to/wordlist.txt
 
线程和性能
–threads THREADS
指定扫描线程数(默认值:20)
-t 10
 
–timeout SECONDS
设置请求超时时间(默认值:3秒)
--timeout 5
 
–delay MILLISECONDS
设置每次请求之间的延迟
--delay 500
 
忽略状态码
–exclude-status CODES
 逗号分隔的要忽略的 HTTP 状态码列表。
-x 400,403,404
 
代理和请求设置
–proxy PROXY
使用代理服务器
--proxy http://127.0.0.1:8080
 
–headers HEADERS
添加自定义 HTTP 请求头
--headers "User-Agent: Custom,Authorization: Bearer <token>"
 
保存结果
–output FILE
将结果保存到指定文件
--output result.txt
 
其他选项
–recursive
递归扫描找到的目录
-r
 
–recursive-depth DEPTH
设置递归扫描的最大深度
-R 3
 
–exclude-sizes SIZES
逗号分隔的要忽略的响应大小列表
--exclude-sizes 0B,123KB
 
–exclude-text TEXT
忽略包含指定文本的响应
--exclude-text "Not Found"
 
–force-extensions
强制所有字典条目带上扩展名
-f
 
–full-url
在输出中显示完整的 URL
–random-agent
使用随机的 User-Agent
-c FILE, --config FILE
使用配置文件
完整命令示例
python3 dirsearch.py -u http://example.com -e php,html,js -w /path/to/wordlist.txt -x 404,403 -t 20 --timeout=5 --proxy=http://127.0.0.1:8080 --output=result.txt 
- 扫描 http://example.com
 - 搜索 .php, .html, 和 .js 扩展名的文件
 - 使用指定的字典文件 /path/to/wordlist.txt
 - 忽略状态码 404 和 403
 - 使用 20 个线程
 - 请求超时时间设置为 5 秒
 - 通过 http://127.0.0.1:8080 代理进行扫描
 - 将结果保存到 result.txt
 
查看帮助
使用 -h 或 --help 参数来查看 dirsearch 的所有选项和用法:
python3 dirsearch.py -h
 
常用组合
基本扫描
python3 dirsearch.py -u http://example.com
 
使用特定扩展名和字典文件
python3 dirsearch.py -u http://example.com -e php,html -w /path/to/wordlist.txt
 
使用代理和自定义头
python3 dirsearch.py -u http://example.com --proxy http://127.0.0.1:8080 --headers "User-Agent: Custom"
 
保存结果并忽略状态码
python3 dirsearch.py -u http://example.com --output result.txt -x 404,403
 
总结
dirsearch 是一个强大的工具,通过其各种选项和灵活的配置,可以有效地扫描和枚举目标 Web 服务器上的隐藏目录和文件。
GitHub官方文档仓库:https://github.com/maurosoria/dirsearch
