How to Use Dirb for Directory Enumeration in Kali Linux

Install Dirb

Dirb is a powerful directory enumeration tool that is used to discover hidden files and directories on web servers. It is included in the Kali Linux distribution and can be used to quickly enumerate web directories. In this tutorial, we will show you how to install and use Dirb in Kali Linux.

To install Dirb, open a terminal window and type the following command:

sudo apt-get install dirb

Once the installation is complete, you can run Dirb by typing the following command:

dirb

You can also use the official documentation for more information on how to use Dirb. Once you have installed Dirb, you can start using it to enumerate web directories.

Run Dirb

Dirb is a powerful directory enumeration tool that can be used to discover hidden files and directories on web servers. To run Dirb, open a terminal window in Kali Linux and type the following command: dirb http://example.com. This will initiate a scan of the specified website and search for any hidden directories or files. You can also specify a wordlist to use for the scan, which can be done by adding the -w flag followed by the path to the wordlist file. For example, dirb http://example.com -w /usr/share/wordlists/dirb/common.txt. You can also use proxies to scan the website, which can be done by adding the -p flag followed by the proxy address. For example, dirb http://example.com -p http://127.0.0.1:8080. Additionally, you can use the -r flag to enable recursive scanning, which will scan all subdirectories of the specified website. For example, dirb http://example.com -r. Once the scan is complete, the results will be displayed in the terminal window. You can also view the results in a web browser by navigating to the http://example.com/dirb/ directory.

View the Results

Once you have run Dirb, you can view the results in the terminal window. The results will show the directory and file names that Dirb has found. You can also view the results in a text file. To do this, use the -o option when running Dirb. This will save the results to a text file. You can then open the text file to view the results.

dirb http://example.com/ -o results.txt

The results will show the directory and file names that Dirb has found. You can also view the results in a text file. To do this, use the -o option when running Dirb. This will save the results to a text file. You can then open the text file to view the results. You can also use the -r option to recursively scan the directories and subdirectories. This will give you a more comprehensive list of the directories and files that Dirb has found.

Use Wordlists

Wordlists are a great way to increase the effectiveness of Dirb. Wordlists are collections of words that are used to guess the names of directories and files on a web server. By using a wordlist, Dirb can quickly and easily identify hidden directories and files on a web server. To use a wordlist with Dirb, you need to specify the path to the wordlist file in the command line. For example, if you have a wordlist file named “wordlist.txt” in the same directory as Dirb, you can use the following command to use the wordlist:

dirb http://example.com/ /path/to/wordlist.txt

You can also use multiple wordlists in a single command. To do this, you need to specify the path to each wordlist file in the command line. For example, if you have two wordlist files named “wordlist1.txt” and “wordlist2.txt” in the same directory as Dirb, you can use the following command to use both wordlists:

dirb http://example.com/ /path/to/wordlist1.txt /path/to/wordlist2.txt

You can find a variety of wordlists online, such as SecLists and FuzzDB. It is important to note that some wordlists may contain words that are not appropriate for use in a production environment. Therefore, it is important to review the wordlist before using it with Dirb.

Use Proxies

Using proxies with Dirb can be a great way to hide your identity while performing directory enumeration. To use a proxy with Dirb, you need to specify the proxy address and port in the command line. For example, if you are using a proxy with the address 192.168.1.1 and port 8080, you would use the following command:

dirb http://example.com/ -p 192.168.1.1:8080

You can also use a SOCKS proxy with Dirb. To do this, you need to specify the proxy type and address in the command line. For example, if you are using a SOCKS proxy with the address 192.168.1.1 and port 1080, you would use the following command:

dirb http://example.com/ -P socks4://192.168.1.1:1080

You can also use a proxy list with Dirb. To do this, you need to specify the proxy list file in the command line. For example, if you are using a proxy list file named “proxy_list.txt”, you would use the following command:

dirb http://example.com/ -i proxy_list.txt

Using proxies with Dirb can be a great way to protect your identity while performing directory enumeration. It is important to remember to use a secure proxy and to use a proxy list file if you are using multiple proxies. For more information on using proxies with Dirb, please refer to the Dirb documentation.

Use Recursive Scanning

Recursive scanning is a powerful feature of Dirb that allows you to scan a website for all its subdirectories and files. This is especially useful when you are trying to find hidden directories and files on a website. To use recursive scanning, you need to use the -r flag when running Dirb. For example, if you wanted to scan the website example.com recursively, you would run the following command:

dirb https://example.com -r

This will scan the website for all its subdirectories and files. You can also specify a wordlist to use when scanning. To do this, you need to use the -w flag. For example, if you wanted to scan the website example.com using the wordlist wordlist.txt, you would run the following command:

dirb https://example.com -r -w wordlist.txt

This will scan the website for all its subdirectories and files using the specified wordlist. You can also specify a proxy to use when scanning. To do this, you need to use the -p flag. For example, if you wanted to scan the website example.com using the proxy 127.0.0.1:8080, you would run the following command:

dirb https://example.com -r -p 127.0.0.1:8080

This will scan the website for all its subdirectories and files using the specified proxy. Recursive scanning is a powerful feature of Dirb that can help you find hidden directories and files on a website. It is important to remember to use the -r flag when running Dirb to enable recursive scanning.

Useful Links