root@sparrow:~/writeups$ cat dirb.md
// web
Dirb
21 Jul 2026
· 3 min read
DIRB is a web content scanner that discovers hidden directories and files through dictionary-based brute force. It fires HTTP requests at the target URL, testing each wordlist entry and reporting the responses that exist. It is a classic, simple and stable tool, ideal for the enumeration phase of a web audit.
The key to DIRB is understanding that the quality of its results depends entirely on the wordlist and on how it tells what exists from what does not. By default it treats anything other than a 404 as valid, so against applications that return 200 on non-existent pages you should tune detection with -N or -f. Its automatic recursion can explode the request count, something to control with -r and -z.
1. Beginner level — wordlists, extensions and output

| Command | What it does |
|---|---|
dirb <t> | Basic scan with the default wordlist |
dirb <t> <wordlist> | Use a custom wordlist |
dirb <t> -X .php,.txt | Add extensions to the search |
dirb <t> -o out.txt | Save results to a file |
dirb <t> -r | Disable recursive scanning |
dirb <t> -S | Silent mode |
dirb <t> -z 10 | Add a delay between requests (ms) |
dirb <t> -w | Do not stop on warnings |
dirb <t> -v | Also show not-found pages |
dirb <t> -N 404 | Ignore a specific response code |
dirb <t> -t | Do not force a trailing "/" on the URL |
dirb <t> -i | Case-insensitive search |
dirb <t> -l | Show the "Location" header |
dirb <t> -R | Enable interactive recursion |
2. Advanced level — auth, proxy and evasion

| Command | What it does |
|---|---|
dirb <t> -H "Auth: Bearer x" | Add a custom header |
dirb <t> -c "PHPSESSID=x" | Add cookies to the request |
dirb <t> -u user:pass | HTTP basic authentication |
dirb <t> -p proxy:8080 | Route requests through a proxy |
dirb <t> -P user:pass | Authenticate against the proxy |
dirb <t> -a "Mozilla/5" | Customize the User-Agent |
dirb <t> -f | Tune NOT_FOUND detection |
dirb <t> -X .bak,.old,.zip | Search typical backup extensions |
dirb <t> -z 500 -w | Evasion: delay + ignore warnings |
dirb <t> <wl> -o out.txt -S | Silent with output to a file |
dirb <t> -p https://proxy:8080 | Proxy over HTTPS too |
dirb <t> -X .php -i -r | Combine extension, case-insensitive and non-recursive |
dirb <t> -N 500,502,503 | Ignore several error codes at once |
dirb <t> -c "a=1" -H "X-Fwd:127.0.0.1" | Combine cookies and headers for bypass |
3. Details people miss
- DIRB only ships small wordlists; for serious results point it at dictionaries such as those in
SecListsunder/usr/share/wordlistsinstead of the default list. - By default it flags as "found" anything that does not return a 404. If the app answers 200 on non-existent paths (custom error pages), use
-Nto ignore codes or-fto fine-tune NOT_FOUND detection and avoid hundreds of false positives. - Recursion is on by default: DIRB descends into every directory it finds and multiplies requests. On large targets disable it with
-rand add-zso you don't hammer the server or trip the WAF. -Xappends specific extensions (.php,.txt) and is different from-x, which reads a list of extensions from a file. Mixing them up is a common mistake.- DIRB is single-threaded with no concurrency, so it is noticeably slower than
gobusterorffuf. Use it when stability and simplicity matter more than speed.
Responsible use
These commands are for systems you own or have explicit written authorisation to test (labs, CTFs, contracted engagements). Using them against third-party infrastructure without permission is illegal in most countries.