1 介绍
有勇气的牛排 — 攻防
Kali Linux提供一款基于字典的Web目录扫描工具DIRB。该工具根据用户提供的字典,对目标网站目录进行暴力猜测。它会尝试以递归方式进行爆破,以发现更多的路径。同时,该工具支持代理、HTTP认证扫描限制访问的网站。该工具还提供两个命令,帮助用户从网页生成字典,或者生成定制字典。
1.1 什么是dirb
DIRB 是一个基于命令行的工具,可以根据单词列表对任何目录进行暴力破解。 DIRB 会发出一个 HTTP 请求,并查看每个请求的 HTTP 响应代码
1.2 如何工作
它内部有一个 wordlist 文件,默认情况下大约有 4000 个单词用于暴力攻击。 互联网上有很多更新的词表,也可以使用。 Dirb 在网站或服务器的每个目录或对象中搜索其词表中的单词。 它可能是容易受到攻击的管理面板或子目录。 关键是找到对象,因为它们通常是隐藏的。
2 安装
via Sourceforge:https://sourceforge.net/projects/dirb/
2.1 Ubuntu
apt install dirb
3 实战演练
3.1 help
-a <agent_string> : Specify your custom USER_AGENT.
-c <cookie_string> : Set a cookie for the HTTP request.
-f : Fine tunning of NOT_FOUND (404) detection.
-H <header_string> : Add a custom header to the HTTP request.
-i : Use case-insensitive search.
-l : Print "Location" header when found.
-N <nf_code>: Ignore responses with this HTTP code.
-o <output_file> : Save output to disk.
-p <proxy[:port]> : Use this proxy. (Default port is 1080)
-P <proxy_username:proxy_password> : Proxy Authentication.
-r : Don't search recursively.
-R : Interactive recursion. (Asks for each directory)
-S : Silent Mode. Don't show tested words. (For dumb terminals)
-t : Don't force an ending '/' on URLs.
-u <username:password> : HTTP Authentication.
-v : Show also NOT_FOUND pages.
-w : Don't stop on WARNING messages.
-X <extensions> / -x <exts_file> : Append each word with this extensions.
-z <milisecs> : Add a miliseconds delay to not cause excessive Flood.
常用参数
-a 设置ua
-c 设置cookie带cookie扫描
-N 忽略某些响应码
-o 输出结果
-p 使用代理
-X 在每个测试目录上附加后缀
-z 设置毫秒延迟
3.2 正常扫描
默认
dirb 目标
自带字典
dirb 目标 字典路径
3.3 设置 ua 和 cookie
dirb 目标 字典路径 -a "ua" -c "cookie"
这里ua
和 cookie
的值自己填,截图中没有填
3.4 使用代理和输出结果
dirb 目标 字典路径 -p ip:port -o result.txt
3.5 设置附加后缀
dirb 目标 字典路径 -X test(这样每个被测试的字典都附加了test)
3.6 设置毫秒延迟
如果目标存在一些安全程序爬扫描太快被屏蔽的话可以设置-z参数单位是毫秒
dirb 目标 字典路径 -z 1000 (1秒)
现在是1秒
访问一次
参考文章:
https://zhuanlan.zhihu.com/p/26549845
https://medium.com/tech-zoom/dirb-a-web-content-scanner-bc9cba624c86