![Kali Linux:An Ethical Hacker's Cookbook(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/772/36698772/b_36698772.jpg)
How to do it...
Since GoBuster is built on Go, we first need to install Go on Kali:
- Do this by using the following command:
apt install golang
- First, we clone the Git repository from the following URL: https://github.com/OJ/gobuster. You will see the following output:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/d04275eb-060a-4b40-bf93-d0f84e27d522.png?sign=1739282561-gq6nOtL0w80MEmuCOfwRxjq8cJEw467y-0-ec53097cd85f8cce854bfd92e741e87c)
- Now, browse into the directory and pull the external dependencies before building the binary using the following command:
go get -u github.com/OJ/gobuster && go build
The following screenshot shows the output of the preceding command:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/ac78420d-2fa6-4790-81e7-9f2a69fe45f7.png?sign=1739282561-mC6VB3uTujJnsSeeB8dWpefMk4LugS8T-0-fc89d59e002a9eedf185232bb6d6d255)
As we can see from the preceding screenshot, the build command completed successfully without any error.
- Now, run the help command and see what options are available for us to use:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/3ed0ac06-f97d-4edd-b3cf-50c90deb38d9.png?sign=1739282561-5RvFzUFmwsXTCZcBDFZaiClcSWZlS0vv-0-1162ac27da2d185581440d3042c40919)
Gobuster has lots of features such as brute forcing directories that are behind HTTP authentication, setting a custom user-agent, and so on. Let's try it.
By default, Gobuster needs a wordlist. We can use the -w flag to specify a list and -x to specify the extension of the file we are trying to brute force:
./gobuster -x php -u "http://testphp.vulnweb.com/" -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt
The following screenshot shows the output of the preceding command:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/2d5f9b0c-49e5-43d5-bf50-5a6c5227e87a.png?sign=1739282561-f4hVgVL8p60RSyuQMLfOUubrmJN2Qwhz-0-c8243382692b74bbc0d9784e57db15f0)
As we can see in the preceding screenshot, the tool successfully starts brute forcing and returns the page responses for everything it finds.