1. INTRODUCTION
Dirb is a classic web content scanner used for discovering hidden directories and files on web servers.
It works by requesting each entry from a wordlist and analyzing responses.
Useful in pentests and CTFs for locating admin panels, backups, APIs, and misconfigurations.
2. BASIC USAGE
Simple scan:
dirb http://target.com
With a custom wordlist:
dirb http://target.com /usr/share/wordlists/dirb/common.txt
3. SCANNING HTTPS
Use -S flag for SSL sites:
dirb https://target.com -S
4. USING PROXY
Send traffic through a proxy (e.g., Burp Suite):
dirb http://target.com -p http://127.0.0.1:8080
5. EXTENSION SCAN
Scan specific file extensions:
dirb http://target.com -X .php,.txt,.bak
Example:
dirb http://ctf.local -X .php,.html
6. IGNORING CERTIFICATE ERRORS
Ignore invalid SSL certificates:
dirb https://target.com -k
7. AUTHENTICATION SUPPORT
Basic authentication:
dirb http://target.com -u admin:password
Useful for targeting protected web areas.
8. BRUTE FORCE SUBDIRECTORIES
Recursive mode:
dirb http://target.com -r
Be cautious — recursion can be slow and noisy.
9. FILTERING RESPONSES
Exclude certain HTTP status codes:
dirb http://target.com -N 404
Useful when custom 404 pages create noise.
10. COOKIE INJECTION
Set cookie manually:
dirb http://target.com -c "sessionid=abc123"
Useful for authenticated enumeration.
11. HEADER INJECTION
Add custom header:
dirb http://target.com -H "User-Agent: Mozilla/5.0"
Helps bypass WAFs or fingerprinting checks.
12. INDIVIDUAL FILE WORDLISTS
Search for backup-related files:
dirb http://target.com backups.txt -X .zip,.old,.bak
13. FULL PENETEST WORKFLOW EXAMPLES
Find admin panel:
dirb http://target.com /usr/share/dirb/wordlists/common.txt
Search for backup archives:
dirb http://target.com /usr/share/wordlists/backups.txt -X .zip,.bak,.tar
Scan API host:
dirb http://api.target.com api-endpoints.txt
Use authenticated cookie for deeper discovery:
dirb http://target.com -c "auth=true;role=admin"
Use proxy through Burp Suite:
dirb http://target.com -p http://127.0.0.1:8080
← Back to tutorial