Ultimate Dirb Cheat Sheet



Ultimate Dirb Cheat Sheet

The classic web content scanner for brute-forcing hidden directories and files.

1. Basic Scanning

The simplest way to use Dirb. It uses the default wordlist (common.txt) if none is provided.

Standard Scan

Scan a URL recursively.

dirb http://target.com/

Non-Recursive Scan

Do not enter subdirectories found (Faster).

dirb http://target.com/ -r

Ignore Status Codes

Don't show results with 403 Forbidden or 302 Found status.

dirb http://target.com/ -N 302

2. Wordlists

Dirb's power depends on the wordlist you use. It comes with several built-in lists.

Using a Custom Wordlist

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

Built-in Wordlist Locations

Usually located in /usr/share/dirb/wordlists/.

common.txt

Small, fast. The default list.

big.txt

Larger list. Use if 'common' finds nothing.

vulns/

Specific lists for known vulnerable apps (cgis.txt, tomcat.txt).

3. File Extensions

Search for specific file types (like .php, .html, .zip) by appending extensions to every word in the list.

Specific Extension (-X)

Look for PHP files.

dirb http://target.com/ -X .php

Multiple Extensions (-x)

Use a file containing a list of extensions (e.g., .php, .html, .bak).

dirb http://target.com/ -x extensions.txt

4. Authentication & Headers

Bypass basic protections or scan behind login prompts.

HTTP Basic Auth

dirb http://target.com/ -u admin:password

Custom User-Agent (-a)

Spoof your browser to look legitimate or bypass filters.

dirb http://target.com/ -a "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"

Custom Cookie (-c)

Pass a session cookie (e.g., PHPSESSID) to scan as a logged-in user.

dirb http://target.com/ -c "PHPSESSID=12345abcdef"

5. Performance & Output

Add Delay (-z)

Wait X milliseconds between requests (Throttling/Stealth).

dirb http://target.com/ -z 100

Save Output (-o)

Save findings to a file for later analysis.

dirb http://target.com/ -o scan_results.txt

Silent Mode (-S)

Don't print testing words, only print found items.

dirb http://target.com/ -S