一、gobuster简单介绍
Gobuster是一种用于暴力的工具:
-
网站中的URI(目录和文件)。
-
DNS子域(支持通配符)。
-
目标网络服务器上的虚拟主机名。
-
打开亚马逊S3存储桶
-
打开谷歌云桶
-
TFTP服务器
GitHub项目地址:
https://github.com/OJ/gobuster
kali系统安装命令:
sudo apt-get install gobuster
二、gobuster的详细使用
全局标志
全局标志:
--delay duration 每个线程在请求之间等待的时间(例如1500ms)
--no-color 禁用颜色输出
--no-error 不显示错误
-z, --no-progress 不显示进度
-o, --output string 将结果写入的输出文件(默认为stdout)
-p, --pattern string 包含替换模式的文件
-q, --quiet 不要打印横幅和其他噪音
-t, --threads int 并发线程数(默认为10)
-v, --verbose 详细输出(错误)
-w, --wordlist string 单词列表的路径
1."dir"模式(目录爆破模式)
使用目录/文件枚举模式
用法:
Gobuster dir [flags]
Flags:
-f, --add-slash 附加/到每个请求
-c, --cookies string 用于Cookie的请求
-d, --discover-backup 通过附加多个备份扩展名来搜索备份文件
--exclude-length ints 排除以下内容长度(完全忽略状态)。提供多次以排除多种尺寸
-e, --expanded 扩展模式,打印完整URL地址
-x, --extensions string 要搜索的文件扩展名
-r, --follow-redirect 跟随重定向
-H, --headers stringArray 指定 HTTP 标头,-H 'Header1: val1' -H 'Header2: val2'
-h, --help 帮助目录
--hide-length 在输出中隐藏正文的长度
-m, --method string 使用以下HTTP方法(默认为“GET”)
-n, --no-status 不打印状态代码
-k, --no-tls-validation 跳过TLS证书验证
-P, --password string 基本身份验证的密码
--proxy string 用于请求的代[http(s)://host:port]
--random-agent 使用随机的用户代理字符串
--retry 应在请求超时时重试
--retry-attempts int 请求超时重试次数(默认为3)
-s, --status-codes string 正状态代码(如果设置,将被状态代码黑名单覆盖)
-b, --status-codes-blacklist string 否定状态代码(如果设置,将覆盖状态代码)(默认为“404”)
--timeout duration HTTP超时(默认10s)
-u, --url string 目标URL
-a, --useragent string 设置用户代理字符串(默认为“gobuster/3.2.0”)
-U, --username string 基本身份验证的用户名
使用实例
gobuster dir -u https://mysite.com/path/to/folder -c 'session=123456' -t 50 -w common-files.txt -x .php,.html
默认选项如下所示:
gobuster dir -u https://buffered.io -w ~/wordlists/shortlist.txt
===============================================================
Gobuster v3.2.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Mode : dir
[+] Url/Domain : https://buffered.io/
[+] Threads : 10
[+] Wordlist : /home/oj/wordlists/shortlist.txt
[+] Status codes : 200,204,301,302,307,401,403
[+] User Agent : gobuster/3.2.0
[+] Timeout : 10s
===============================================================
2019/06/21 11:49:43 Starting gobuster
===============================================================
/categories (Status: 301)
/contact (Status: 301)
/posts (Status: 301)
/index (Status: 200)
===============================================================
2019/06/21 11:49:44 Finished
===============================================================
禁用状态代码的默认选项如下所示:
gobuster dir -u https://buffered.io -w ~/wordlists/shortlist.txt -n
===============================================================
Gobuster v3.2.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Mode : dir
[+] Url/Domain : https://buffered.io/
[+] Threads : 10
[+] Wordlist : /home/oj/wordlists/shortlist.txt
[+] Status codes : 200,204,301,302,307,401,403
[+] User Agent : gobuster/3.2.0
[+] No status : true
[+] Timeout : 10s
===============================================================
2019/06/21 11:50:18 Starting gobuster
===============================================================
/categories
/contact
/index
/posts
===============================================================
2019/06/21 11:50:18 Finished
===============================================================
详细输出如下所示:
gobuster dir -u https://buffered.io -w ~/wordlists/shortlist.txt -v
===============================================================
Gobuster v3.2.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Mode : dir
[+] Url/Domain : https://buffered.io/
[+] Threads : 10
[+] Wordlist : /home/oj/wordlists/shortlist.txt
[+] Status codes : 200,204,301,302,307,401,403
[+] User Agent : gobuster/3.2.0
[+] Verbose : true
[+] Timeout : 10s
===============================================================
2019/06/21 11:50:51 Starting gobuster
===============================================================
Missed: /alsodoesnotexist (Status: 404)
Found: /index (Status: 200)
Missed: /doesnotexist (Status: 404)
Found: /categories (Status: 301)
Found: /posts (Status: 301)
Found: /contact (Status: 301)
===============================================================
2019/06/21 11:50:51 Finished
===============================================================
显示内容长度的示例:
gobuster dir -u https://buffered.io -w ~/wordlists/shortlist.txt -l
===============================================================
Gobuster v3.2.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Mode : dir
[+] Url/Domain : https://buffered.io/
[+] Threads : 10
[+] Wordlist : /home/oj/wordlists/shortlist.txt
[+] Status codes : 200,204,301,302,307,401,403
[+] User Agent : gobuster/3.2.0
[+] Show length : true
[+] Timeout : 10s
===============================================================
2019/06/21 11:51:16 Starting gobuster
===============================================================
/categories (Status: 301) [Size: 178]
/posts (Status: 301) [Size: 178]
/contact (Status: 301) [Size: 178]
/index (Status: 200) [Size: 51759]
===============================================================
2019/06/21 11:51:17 Finished
===============================================================
静音输出,状态禁用和扩展模式看起来像这样(“grep模式”):
gobuster dir -u https://buffered.io -w ~/wordlists/shortlist.txt -q -n -e
https://buffered.io/index
https://buffered.io/contact
https://buffered.io/posts
https://buffered.io/categories
2.dns模式(域名爆破模式)
使用DNS子域枚举模式
用法:
gobuster dns [flags]
Flags:
-d, --domain string 目标域
-h, --help 帮助目录
-r, --resolver string 使用自定义DNS服务器(格式为server.com或server.com:port)
-c, --show-cname 显示CNAME记录(不能与“-i”选项一起使用)
-i, --show-ips 显示IP地址
--timeout duration DNS解析程序超时(默认1秒)
--wildcard 找到通配符时强制继续操作
使用实例
gobuster dns -d mysite.com -t 50 -w common-names.txt
正常的样本运行是这样的:
gobuster dns -d google.com -w ~/wordlists/subdomains.txt
===============================================================
Gobuster v3.2.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Mode : dns
[+] Url/Domain : google.com
[+] Threads : 10
[+] Wordlist : /home/oj/wordlists/subdomains.txt
===============================================================
2019/06/21 11:54:20 Starting gobuster
===============================================================
Found: chrome.google.com
Found: ns1.google.com
Found: admin.google.com
Found: www.google.com
Found: m.google.com
Found: support.google.com
Found: translate.google.com
Found: cse.google.com
Found: news.google.com
Found: music.google.com
Found: mail.google.com
Found: store.google.com
Found: mobile.google.com
Found: search.google.com
Found: wap.google.com
Found: directory.google.com
Found: local.google.com
Found: blog.google.com
===============================================================
2019/06/21 11:54:20 Finished
===============================================================
显示IP样本运行是这样的:
gobuster dns -d google.com -w ~/wordlists/subdomains.txt -i
===============================================================
Gobuster v3.2.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Mode : dns
[+] Url/Domain : google.com
[+] Threads : 10
[+] Wordlist : /home/oj/wordlists/subdomains.txt
===============================================================
2019/06/21 11:54:54 Starting gobuster
===============================================================
Found: www.google.com [172.217.25.36, 2404:6800:4006:802::2004]
Found: admin.google.com [172.217.25.46, 2404:6800:4006:806::200e]
Found: store.google.com [172.217.167.78, 2404:6800:4006:802::200e]
Found: mobile.google.com [172.217.25.43, 2404:6800:4006:802::200b]
Found: ns1.google.com [216.239.32.10, 2001:4860:4802:32::a]
Found: m.google.com [172.217.25.43, 2404:6800:4006:802::200b]
Found: cse.google.com [172.217.25.46, 2404:6800:4006:80a::200e]
Found: chrome.google.com [172.217.25.46, 2404:6800:4006:802::200e]
Found: search.google.com [172.217.25.46, 2404:6800:4006:802::200e]
Found: local.google.com [172.217.25.46, 2404:6800:4006:80a::200e]
Found: news.google.com [172.217.25.46, 2404:6800:4006:802::200e]
Found: blog.google.com [216.58.199.73, 2404:6800:4006:806::2009]
Found: support.google.com [172.217.25.46, 2404:6800:4006:802::200e]
Found: wap.google.com [172.217.25.46, 2404:6800:4006:802::200e]
Found: directory.google.com [172.217.25.46, 2404:6800:4006:802::200e]
Found: translate.google.com [172.217.25.46, 2404:6800:4006:802::200e]
Found: music.google.com [172.217.25.46, 2404:6800:4006:802::200e]
Found: mail.google.com [172.217.25.37, 2404:6800:4006:802::2005]
===============================================================
2019/06/21 11:54:55 Finished
===============================================================
当基域无法解析时,基域验证警告。这是一个警告,而不是如果用户在键入域时发胖的手指,这是一个失败。
gobuster dns -d yp.to -w ~/wordlists/subdomains.txt -i
===============================================================
Gobuster v3.2.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Mode : dns
[+] Url/Domain : yp.to
[+] Threads : 10
[+] Wordlist : /home/oj/wordlists/subdomains.txt
===============================================================
2019/06/21 11:56:43 Starting gobuster
===============================================================
2019/06/21 11:56:53 [-] Unable to validate base domain: yp.to
Found: cr.yp.to [131.193.32.108, 131.193.32.109]
===============================================================
2019/06/21 11:56:53 Finished
===============================================================
通配符DNS也被正确检测到:
gobuster dns -d 0.0.1.xip.io -w ~/wordlists/subdomains.txt
===============================================================
Gobuster v3.2.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Mode : dns
[+] Url/Domain : 0.0.1.xip.io
[+] Threads : 10
[+] Wordlist : /home/oj/wordlists/subdomains.txt
===============================================================
2019/06/21 12:13:48 Starting gobuster
===============================================================
2019/06/21 12:13:48 [-] Wildcard DNS found. IP address(es): 1.0.0.0
2019/06/21 12:13:48 [!] To force processing of Wildcard DNS, specify the '--wildcard' switch.
===============================================================
2019/06/21 12:13:48 Finished
===============================================================
如果用户想要强制处理具有通配符条目的域,请使用--wildcard
:
gobuster dns -d 0.0.1.xip.io -w ~/wordlists/subdomains.txt --wildcard
===============================================================
Gobuster v3.2.0
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Mode : dns
[+] Url/Domain : 0.0.1.xip.io
[+] Threads : 10
[+] Wordlist : /home/oj/wordlists/subdomains.txt
===============================================================
2019/06/21 12:13:51 Starting gobuster
===============================================================
2019/06/21 12:13:51 [-] Wildcard DNS found. IP address(es): 1.0.0.0
Found: 127.0.0.1.xip.io
Found: test.127.0.0.1.xip.io
===============================================================
2019/06/21 12:13:53 Finished
===============================================================
3.vhost模式(虚拟主机爆破模式)
使用VHOST枚举模式(您很可能希望使用IP地址作为URL参数)
用法:
gobuster vhost [flags]
Flags:
--append-domain 将URL中的主域附加到单词列表中的单词。否则,需要在单词列表中指定完全限定的域。
-c, --cookies string 用于Cookie的请求
--domain string 使用IP地址作为URL时要附加的域。如果保留为空并且指定了基于域的URL,则会提取URL中的主机名
--exclude-length ints 排除以下内容长度(完全忽略状态)。提供多次以排除多种尺寸。
-r, --follow-redirect 跟随重定向
-H, --headers stringArray 指定 HTTP 标头,-H 'Header1: val1' -H 'Header2: val2'
-h, --help 帮助目录
-m, --method string 使用以下HTTP方法(默认为“GET”)
-k, --no-tls-validation 跳过TLS证书验证
-P, --password string 基本身份验证的密码
--proxy string 用于请求的代理 [http(s)://host:port]
--random-agent 使用随机的用户代理字符串
--retry 应在请求超时时重试
--retry-attempts int 请求超时重试次数(默认为3)
--timeout duration HTTP超时(默认10s)
-u, --url string 目标URL
-a, --useragent string 设置用户代理字符串(默认为“gobuster/3.2.0”)
-U, --username string 基本身份验证的用户名
使用实例
gobuster fuzz -u https://example.com?FUZZ=test -w parameter-names.txt
4. s3模式(枚举打开的S3桶,并查找存在和桶列表)
使用aws bucket枚举模式
用法:
gobuster s3 [flags]
Flags:
-h, --help 帮助目录
-m, --maxfiles int 列出bucket时要列出的最大文件数(仅在详细模式下显示)(默认值为5)
-k, --no-tls-validation 跳过TLS证书验证
--proxy string 用于请求的代理[http(s)://host:port]
--random-agent 使用随机的用户代理字符串
--retry 应在请求超时时重试
--retry-attempts int 请求超时重试次数(默认为3)
--timeout duration HTTP超时(默认10s)
-a, --useragent string 设置用户代理字符串(默认为“gobuster/3.2.0”)
使用实例
gobuster s3 -w bucket-names.txt
5.gcc模式(枚举打开的谷歌云桶)
使用gcs bucket枚举模式
用法:
gobuster gcs [flags]
Flags:
-h, --help 帮助目录
-m, --maxfiles int 列出bucket时要列出的最大文件数(仅在详细模式下显示)(默认值为5)
-k, --no-tls-validation 跳过TLS证书验证
--proxy string 用于请求的代理 [http(s)://host:port]
--random-agent 使用随机的用户代理字符串
--retry Should retry on request timeout
--retry 应在请求超时时重试
--retry-attempts int 请求超时重试次数(默认为3)
--timeout duration HTTP超时(默认10s)
-a, --useragent string 设置用户代理字符串(默认为“gobuster/3.2.0”)
使用实例
gobuster gcs -w bucket-names.txt
6.tftp模式(bruteforce tftp文件)
使用TFTP枚举模式
用法:
gobuster tftp [flags]
Flags:
-h, --help 帮助目录
-s, --server string 目标TFTP服务器
--timeout duration TFTP超时(默认1秒)
使用实例
gobuster tftp -s tftp.example.com -w common-filenames.txt
记得点赞+关注,关注微信公众号菜鸟学渗透,有任何问题可以后台私信我
有考取NISP一级/二级/三级、CISP-PTE/PTS等证书的可以加我好友私信我(公众号回复“加好友”)。