GO KALI FREE
BeginnerTools

Dirb Guide: Web Content Scanner

Learn Dirb for web content discovery and directory brute-forcing with wordlist-based scanning, file extension detection, and security assessment.

#dirb#directory busting#web content scanner#brute force#web enumeration

Why You Need Dirb

You need to find hidden directories and files on a web server that are not linked from the homepage — Dirb brute-forces paths using wordlists. It is one of the oldest and most reliable web content discovery tools, ideal for finding admin panels, backup files, and configuration leaks.

Prerequisites

  • Basic understanding of HTTP and web servers
  • Familiarity with wordlists
  • Authorization for testing
  • Installation

    sudo apt install dirb
    

    Basic Usage

    dirb http://target.com /usr/share/wordlists/dirb/common.txt
    

    Key Options

    | Option | Description |

    |--------|-------------|

    | -w | Don't stop on warnings |

    | -r | Recursive scan |

    | -z MILLIS | Delay between requests |

    | -o FILE | Output file |

    | -X EXT | Append extensions |

    | -x EXT_FILE | Extensions from file |

    | -S | Silent mode |

    Practical Examples

    dirb http://192.168.1.100 /usr/share/wordlists/dirb/common.txt
    dirb http://192.168.1.100 /usr/share/wordlists/dirb/common.txt -X .php,.html,.txt
    dirb http://192.168.1.100 /usr/share/wordlists/dirb/common.txt -r
    dirb http://192.168.1.100 /usr/share/wordlists/dirb/common.txt -z 500
    

    Real-World Example

    dirb http://target.com /usr/share/wordlists/dirb/common.txt -o initial-scan.txt
    dirb http://target.com /usr/share/wordlists/dirb/common.txt -X .php,.html -o extension-scan.txt
    dirb http://target.com /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt -o deep-scan.txt
    

    Common Mistakes

    Using too small a wordlist. Not specifying extensions. Ignoring recursive scans. Scanning without output.

    Best Practices

    Start small, grow larger. Always specify extensions. Use recursion wisely.

    Related Tools

  • **Gobuster**: Faster Go-based alternative
  • **Ffuf**: Fast web fuzzer
  • **Dirsearch**: Python-based brute-forcer
  • Related Articles

  • [Gobuster Guide](/articles/gobuster-guide)
  • [Ffuf Guide](/articles/ffuf-guide)
  • [Nikto Guide](/articles/nikto-guide)
  • Summary

    Dirb is a reliable web content scanner for discovering hidden directories and files.

    Knowledge Check

  • What is Dirb's primary purpose?
  • How does Dirb determine valid paths?
  • What does `-X` do?
  • Difference between Dirb and Gobuster?
  • Why use `-o`?
  • Frequently Asked Questions

    What is Dirb?

    Dirb is a web content scanner that brute-forces directories and files on web servers using wordlists. It sends HTTP requests for each wordlist entry and identifies valid paths based on response codes.

    How does Dirb determine valid paths?

    Dirb checks HTTP response codes: 200 (OK), 301/302 (redirects), and 403 (forbidden) indicate valid paths. 404 responses are filtered out. You can customize which codes to accept.

    What does the -X flag do?

    The `-X` flag appends file extensions to each wordlist entry. For example, `-X .php,.html` tests both `admin` and `admin.php`, `admin.html`, finding hidden files with specific extensions.

    How does Dirb differ from Gobuster?

    Dirb is a single-threaded, sequential scanner. Gobuster is written in Go and supports multi-threading for significantly faster scans. Gobuster is preferred for large-scale discovery, Dirb for smaller targets.

    Why use the -o flag?

    The `-o` flag saves scan results to a file for documentation and further analysis. Without it, results are only displayed on screen and may be lost in large scans.

    What does the -r flag do?

    The `-r` flag enables recursive scanning, where Dirb follows discovered directories and scans their contents. This discovers nested directories but significantly increases scan time.

    What wordlists work best with Dirb?

    Start with `/usr/share/wordlists/dirb/common.txt` for quick scans. Use `directory-list-2.3-medium.txt` for deeper discovery. Custom wordlists from tools like [CeWL](/articles/cewl-guide) provide targeted results.

    What does the -z flag do?

    The `-z` flag adds a delay in milliseconds between requests (e.g., `-z 500`). This prevents overwhelming the server and helps avoid detection by rate-limiting security tools.