# Course #115: dirbuster$ – Uncover Hidden Directories

## Section 1: Introduction to dirbuster$

### Overview

In the realm of web application security, one of the most crucial tasks is identifying all potential entry points and resources on a web server. This is where directory busting tools like `dirbuster$` come into play. `dirbuster$` is a powerful tool that helps penetration testers discover hidden directories and files within web servers, thereby revealing potential vulnerabilities that malicious actors could exploit.

### Installation and Configuration on Kali Linux

Kali Linux is a popular distribution for penetration testing and security assessments, and `dirbuster$` comes pre-installed with it. Follow these steps to check its installation and configuration:

1. **Open Terminal**:
Start your Kali Linux terminal. You can do this by finding the terminal application in your applications menu or using the shortcut `Ctrl + Alt + T`.

2. **Check for dirbuster**:
Enter the following command to check if `dirbuster$` is installed:

3. **Installing dirbuster (if not installed)**:
If `dirbuster$` is not installed, you can install it using the following commands:


sudo apt update
sudo apt install dirbuster

4. **Starting dirbuster**:
You can launch `dirbuster$` from the terminal with the following command:

5. **Graphical User Interface**:
Upon starting `dirbuster$`, you will be greeted with its user-friendly GUI, allowing you to set parameters for your scanning.

### Configuring dirbuster$

1. **Select a URL**:
In the `Target URL` field, enter the URL of the web application you want to test.

2. **Select a Wordlist**:
`dirbuster$` uses wordlists to perform its directory and file brute-forcing. You can choose from built-in lists or add a custom one:
– Click on `Browse` next to the `Select a Wordlist` option.
– You can find the default wordlists in `/usr/share/dirbuster/wordlists/`.

3. **Choose Scan Type**:
You can perform a:
– **Directory scan**
– **File scan**

4. **Set Scan Options**:
– **Number of Threads**: Increase the number of threads for faster scanning.
– **Follow Redirects**: Enable this if you want to follow HTTP redirects during your scan.
– **Use Proxy**: Configure a proxy if you want your traffic to go through a specific route.

5. **Start the Scan**:
After all settings are configured, click on the `Start` button to begin your scan.

### Step-by-Step Usage and Real-World Use Cases

Now that you have installed and configured `dirbuster$`, let's look at how to use it effectively.

#### Step 1: Understanding the Interface

The `dirbuster$` interface is intuitive. It consists of several sections:
– **Target**: Where you enter the URL.
– **Wordlist**: Where you select the list to use.
– **Options**: Where you configure scan settings.
– **Output**: Where the results of the scan will be displayed.

#### Step 2: Performing a Scan

1. **Target Setup**:
Enter a target URL (e.g., `http://example.com`).

2. **Selecting Wordlist**:
You can use a wordlist like `common.txt` found in `/usr/share/dirbuster/wordlists/`.

3. **Starting the Scan**:
Click on `Start`, and observe the progress. You'll see `dirbuster$` attempting to access various directories listed in the wordlist.

#### Real-World Use Cases

1. **Discovering Hidden Admin Pages**:
Many web applications might have hidden admin panels (e.g., `/admin`, `/login`). By using a comprehensive wordlist, `dirbuster$` can help identify these pages.

2. **Finding Backup Files**:
Often developers forget to secure backup files which could contain sensitive information. `dirbuster$` can help find backups like `backup.zip`, `db_backup.sql`, etc.

3. **Enumerating API Endpoints**:
When testing RESTful APIs, you can find hidden endpoints that may not be documented.

4. **Finding Misconfigured Web Server Directories**:
Misconfigured servers might expose sensitive directories. `dirbuster$` can help discover these vulnerabilities.

### Detailed Technical Explanations

`dirbuster$` works on a simple yet effective principle: brute-forcing. It sends HTTP requests to the target URL with paths defined in the wordlist. When a response is received, it analyzes the HTTP response codes to determine the existence of directories or files. Here are some key response codes you might encounter:

– **200 OK**: The directory or file exists.
– **403 Forbidden**: Access is denied but the resource exists.
– **404 Not Found**: The resource does not exist.

Understanding these codes is essential as they inform you about the accessibility of different paths, allowing you to adjust your testing strategy.

### Code Examples for WordPress

If you are targeting a WordPress installation, here is how you can specify some common paths in your wordlist for `dirbuster$`.

"`plaintext
wp-admin
wp-login.php
wp-content
wp-includes
xmlrpc.php
wp-config.php
"`

You can create a custom wordlist file called `wp_wordlist.txt` and add these paths. Configure `dirbuster$` to use this custom list for more targeted scanning.

### External References

For further reading and a deeper understanding of directory busting using `dirbuster$`, the following resources are useful:

– [Kali Linux Official Documentation](https://www.kali.org/docs/)
– [OWASP Directory Traversal](https://owasp.org/www-community/attacks/Directory_Traversal_Attack)
– [Burp Suite: An Introduction](https://portswigger.net/burp/documentation/desktop/getting-started)

### Conclusion

In this section, we introduced `dirbuster$`, explored its installation and configuration on Kali Linux, and walked through its usage with real-world scenarios in mind. Understanding how to utilize this tool effectively can significantly enhance your web application assessments and strengthen your overall security posture.

Made by pablo rotem / פבלו רותם

Pablo Guides