GO KALI FREE

DIRB

Web Application

Beginnermedium risk

DIRB is a web content scanner that finds hidden directories, backup files, and other sensitive content on web servers by launching dictionary-based attacks against a target URL. This beginner tutorial shows how to use DIRB in Kali Linux: install it, run your first scan, read the output, switch wordlists, and hand verified findings to the next tool.

Installation

sudo apt install dirb

Basic Syntax

dirb <url> [wordlist]

Quick Facts

Full Name
DIRB (DIR Brute)
License
GPLv2
Written In
C
Platforms
Linux, macOS
Category
Web Content Scanner
Threading
Single-threaded
First Release
2005
Status
Legacy (unmaintained)

Tool Overview

To use DIRB, run dirb followed by the target URL — for example, dirb http://127.0.0.1:8080. DIRB checks every entry in its default wordlist against the target and reports each path that responds. To use your own wordlist, put its file path right after the URL, and add -X .php,.html to try those extensions on every word.

DIRB is a legacy web content scanner, so the workflow is deliberately simple: check that it runs, confirm you own the target or have written authorization, and pick a lab target. Run a first scan, read the output, and choose one finding to verify. Take the verified result to Nikto or Gobuster for a separate, manual follow-up.

For a first scan on a local practice app, run dirb http://127.0.0.1:8080. A sample excerpt reads: ==> DIRECTORY: http://127.0.0.1:8080/admin/ — DIRB thinks admin is a directory; + http://127.0.0.1:8080/login.php (CODE:200|SIZE:1234) — the login page responded; + http://127.0.0.1:8080/server-status (CODE:403|SIZE:277) — access was denied, which does not prove sensitive content; + http://127.0.0.1:8080/test (CODE:301|SIZE:0) — the path redirects. Read each line as a lead, then verify the interesting ones in your browser.

On Kali, DIRB defaults to common.txt, a list of about 4,600 entries in /usr/share/dirb/wordlists/. Switch to big.txt if the default scan misses routes you expect and you can afford more requests. To use a custom wordlist, pass its file path as the second positional argument, right after the URL. The vulns/ subdirectory holds specialized lists, and SecLists is another source of web-content wordlists.

On macOS, run brew install dirb and look for the wordlists under your Homebrew prefix. There is no native Windows build, so use Kali in a VM or in WSL. There is no official online version of DIRB — run it locally, on a system you own or are authorized to test.

DIRB is a web content scanner that discovers hidden directories, backup files, and sensitive content on web servers by launching dictionary-based attacks against the target URL.

Written in C, DIRB sends HTTP requests for each entry in a wordlist and identifies existing paths based on HTTP response codes. It includes a built-in wordlist for quick scans.

While DIRB is a legacy tool largely replaced by faster alternatives like ffuf and gobuster, it remains useful for beginners due to its simple command-line syntax and minimal configuration requirements.

Quick Reference Commands

Verified quick-reference commands for DIRB
CommandPurpose
dirb http://127.0.0.1:8080/ /usr/share/wordlists/dirb/common.txtRun basic recursive content discovery.
dirb http://127.0.0.1:8080/ /usr/share/wordlists/dirb/common.txt -r -z 500Disable recursion and wait 500 ms between requests.
dirb http://127.0.0.1:8080/ /usr/share/wordlists/dirb/common.txt -X .php,.htmlAdd PHP and HTML extension variants.
dirb http://127.0.0.1:8080/ /usr/share/wordlists/dirb/common.txt -o dirb.txtSave findings to text.
dirb | Kali Linux Tools

Common Commands

dirb http://192.168.1.1Basic scan - Launch a standard directory discovery scan using the default built-in wordlist
dirb http://192.168.1.1 /usr/share/wordlists/dirb/big.txtThorough scan - Use a larger, more comprehensive wordlist for deeper hidden directory discovery
dirb http://192.168.1.1 -o results.txtSave results - Export and log the tool's scan output into a text file for documentation
dirb http://192.168.1.1 -a "Mozilla/5.0"Custom user agent - Spoof the request header to avoid detection by basic user-agent filters
dirb http://192.168.1.1 -X .php,.html,.txtAppend extensions - Try .php, .html and .txt variants of every word in the list
dirb http://192.168.1.1 -c "session=abc123"Cookie - Send a session cookie to scan authenticated areas
dirb http://192.168.1.1 -H "Authorization: Bearer TOKEN"Custom header - Add an authorization or custom header to each request
dirb http://192.168.1.1 -p 127.0.0.1:8080Proxy - Route requests through Burp or another HTTP proxy
dirb http://192.168.1.1 -z 100Throttle - Add a millisecond delay between requests to avoid detection
dirb http://192.168.1.1 -rNon-recursive - Scan only the top level, skipping subdirectories
dirb https://192.168.1.1 -wWarnings - Continue scanning even when warning conditions occur
dirb http://192.168.1.1 -N 403Ignore 403 - Skip forbidden responses so only accessible paths are reported
dirb http://192.168.1.1 -RInteractive recursion - Ask before scanning inside each discovered directory
dirb http://192.168.1.1 -SSilent mode - Hide tested words from the output for quieter scans
dirb http://192.168.1.1 -iCase-insensitive - Match paths regardless of letter case
dirb http://192.168.1.1 -fFine-tune 404 detection - Improve how DIRB recognizes not-found responses
dirb http://192.168.1.1 -M "~,.tmp,.old,.backup"Try variations - When a file is found, try backup and temp variants of it
dirb http://192.168.1.1 -x extensions.txtExtensions file - Read the extensions to try from a file
dirb http://192.168.1.1 -u user:passwordBasic auth - Supply a username and password for protected areas

Step-by-Step Guide

  1. 1Run dirb with no arguments to check that the banner and usage text appear. If DIRB is missing on Kali, install it with sudo apt install dirb.
  2. 2Only scan systems you own or have written authorization to test. Start a local practice app, such as DVWA, and make sure it loads at http://127.0.0.1:8080 in your browser.
  3. 3Run your first scan with the default wordlist: dirb http://127.0.0.1:8080.
  4. 4Read CODE as the HTTP status and SIZE as the response body size in bytes. A ==> DIRECTORY line marks a path that DIRB identified as a likely directory.
  5. 5Before trusting any 200 hit, compare it with a random missing path such as http://127.0.0.1:8080/missing-9c3e7b2a in your browser. If the hit returns the same missing-page template with status 200, treat it as a likely soft 404.
  6. 6Use a custom wordlist by passing its file path as the second argument: dirb http://127.0.0.1:8080 ./paths.txt. Make the file one entry per line.
  7. 7Use -X to append .php and .html to each word — it adds requests rather than filtering results: dirb http://127.0.0.1:8080 -X .php,.html. Use -M to try filename variations after DIRB finds a file: dirb http://127.0.0.1:8080 -M "~,.tmp,.old,.backup".
  8. 8Use -N 403 to omit forbidden responses and -r to turn off recursion: dirb http://127.0.0.1:8080 -N 403 -r. Use -R instead of -r if you want DIRB to ask before scanning inside each directory.
  9. 9Use -u for HTTP Basic authentication, -c for a cookie, and -H for a custom header — replace the example values with your lab values, and include -p only if your local proxy is listening on that port: dirb http://127.0.0.1:8080 -u demo:demo -c "session=lab-example" -H "X-Lab: dirb" -p 127.0.0.1:8888.
  10. 10Save the scan output with -o: dirb http://127.0.0.1:8080 -o dirb-results.txt. Record the verified URLs, then check them with Nikto or re-scan the same paths with Gobuster.

Warnings

Use Cases

Simple Directory Discovery

Find hidden directories and files on small web servers using basic wordlist attacks.

Backup File Detection

Discover backup files, config files, and sensitive documents left on web servers.

Quick Content Scanning

Fast setup and execution for small-scale web application reconnaissance.

Learning Directory Brute Force

Beginner-friendly introduction to web content discovery techniques.

Authenticated Area Scanning

Scan login-protected areas with a session cookie, custom header, or basic auth credentials.

Extension Hunting

Find backup and config files by appending .bak, .old, .sql, and .zip extensions to every word.

Key Features

Related Tools

FFUF

Web Application

Learn how to use FFUF (Fuzz Faster U Fool), the extremely fast open-source web fuzzer written in Go: place the FUZZ keyword where a wordlist entry should go, run your first scan, filter the noise, and discover hidden directories, files, parameters, virtual hosts and API endpoints on targets you have permission to test.

DirBuster

Web Application

This how-to guide shows you how to install DirBuster in Kali Linux and use its normal GUI workflow or headless mode in an authorized lab. DirBuster is a multi-threaded Java application from OWASP that brute forces directory and file names on web servers. Version 1.0-RC1 is still shipped on Kali Linux, but it is discontinued and no longer maintained by OWASP.

Gobuster

Web Application

Learn how to use Gobuster, the fast Go-based directory and subdomain brute-forcer, with install steps, your first dir scan, wordlist picks, and result filtering — a beginner tutorial for Kali Linux.

Feroxbuster

Web Application

Feroxbuster is a fast, recursive content discovery tool written in Rust. It is designed to perform forced browsing to find hidden directories and files on web servers using high-performance parallel execution.

Wfuzz

Web Application

Wfuzz is a highly flexible web application fuzzer designed to brute force parameters, discover hidden directories, files, and test for various vulnerabilities by injecting payloads into any HTTP request section.

Arjun

Web Application

Arjun finds hidden HTTP parameters in web applications. It uses a huge default dictionary and smart techniques to discover parameters not visible in the user interface.

Related Cybersecurity Guides

Tools · Beginner

How to Use Dirb: Beginner's Guide to Directory Brute-Forcing in Kali Linux

Learn how to use Dirb in Kali Linux: run your first directory scan, pick the right wordlist, and read the results — with a worked example and cheat sheet.

OSINT · Intermediate

Reconnaissance Workflow: Complete Information Gathering Process

Learn a complete reconnaissance workflow combining OSINT, DNS enumeration, subdomain discovery, and active scanning for comprehensive target profiling.

OSINT · Intermediate

Subdomain Enumeration: Finding Hidden Attack Surface

Master subdomain enumeration techniques using passive and active methods to discover hidden subdomains and expand attack surface mapping.

Tools · Beginner

Nikto Commands: Complete Guide to Web Server Scanning in Kali Linux

Nikto commands cheat sheet: install Nikto, run your first web server scan, read the results, tune scans and save reports — with a worked example.

Frequently Asked Questions

What is the difference between DIRB and Gobuster?

DIRB is the original dictionary-based web content scanner: it has a built-in wordlist and very simple syntax, but it is single-threaded and comparatively slow. Gobuster is a modern multi-threaded alternative written in Go, with additional DNS and virtual-host modes. DIRB still appears in labs, exams and small engagements and works fine on small targets; for large wordlists or many hosts, Gobuster or FFUF will finish much faster.

Where are DIRB wordlists stored in Kali Linux?

DIRB ships its wordlists in /usr/share/dirb/wordlists/. The default list is common.txt; larger lists such as big.txt give deeper coverage at the cost of time. You can also pass any custom wordlist as the second argument, for example: dirb http://192.168.1.1 /path/to/wordlist.txt.

Why is DIRB slow, and how can I speed it up?

DIRB is single-threaded. Use a small relevant wordlist and narrow authorized targets; -r disables recursion when that matches the intended scope. -X adds extension variants and can multiply requests, not simply filter results. -z adds delay to reduce load. Completion time depends on the list, server and network; alternative scanners have different concurrency behavior.

Can DIRB scan through a proxy such as Burp Suite?

Yes. The -p option routes DIRB's requests through a proxy, for example: dirb https://192.168.1.1 -p 127.0.0.1:8080. This lets you watch and modify the scan traffic in Burp Suite while DIRB runs. DIRB also scans https:// URLs directly without extra configuration.

What is DIRB used for?

DIRB is a web content scanner that discovers hidden directories, backup files, and sensitive content on web servers by launching dictionary-based attacks against the target URL.

How does DIRB work?

DIRB sends HTTP requests for each entry in a wordlist or the built-in dictionary. Based on HTTP response codes, it identifies existing directories and files that may not be publicly linked.

Is DIRB still used today?

DIRB remains useful for simple wordlist-based discovery. It recurses by default; -r disables recursion and -R selects interactive recursion. Its single-threaded design and filtering options differ from modern alternatives.

What is the difference between DIRB and DIRBuster?

DIRB is a command-line tool, while DirBuster is a GUI-based Java application. Both perform directory brute forcing but DirBuster offers multi-threading and a graphical interface.

How do I install DIRB?

Install DIRB using: sudo apt install dirb on Kali Linux. On other systems, compile from source or use your package manager.

How do I use DIRB for directory discovery?

Run dirb http://target.com to scan with the built-in wordlist. Use dirb http://target.com /path/to/wordlist.txt for a custom wordlist.

What are the most common DIRB commands?

Common commands include: dirb http://target (basic scan), dirb http://target wordlist.txt (custom wordlist), dirb http://target -o results.txt (save output).

How does DIRB compare to ffuf?

DIRB is single-threaded and slower. ffuf is multi-threaded, faster, and offers advanced filtering. Use ffuf for production; DIRB for learning or small targets.

Is DIRB legal to use?

DIRB itself is legal software. However, scanning web servers without permission from the owner may violate laws. Always obtain written authorization before testing.

What is the -X flag in DIRB?

-X adds extension variants to wordlist candidates, for example -X .php,.html,.txt. It increases the request set rather than merely filtering already discovered results; choose extensions that fit the approved target.

What is the -a flag in DIRB?

The -a flag sets a custom User-Agent string to spoof requests: -a "Mozilla/5.0" to mimic a browser.

How do I save DIRB results?

Use the -o flag: dirb http://target -o results.txt to save scan results to a file for later analysis.

What wordlists does DIRB use?

DIRB has a built-in wordlist and supports custom wordlists. Use SecLists wordlists for more comprehensive scanning.

How long does a DIRB scan take?

DIRB is single-threaded and slow. A basic scan takes 5-30 minutes depending on the wordlist size and target response time.

What HTTP response codes does DIRB show?

DIRB shows 200 (found), 403 (forbidden), 301/302 (redirect), and other codes. 200 indicates accessible content; 403 indicates restricted access.

How do I use DIRB with custom extensions?

Use -X flag: dirb http://target -X .php,.bak,.old to scan for specific file extensions.

Can DIRB scan HTTPS targets?

Yes, DIRB supports HTTPS: dirb https://target.com. It works with both HTTP and HTTPS targets.

How do I use DIRB in Kali Linux?

Kali normally includes DIRB, but if it is missing, install it with sudo apt install dirb. Run dirb http://127.0.0.1:8080 to check your lab with the default wordlist, then read the CODE and SIZE of each hit and verify the interesting ones in your browser.

How do I install DIRB on macOS?

Use Homebrew: brew install dirb. Look for the installed wordlists under your Homebrew prefix, then run dirb against your authorized lab target the same way as on Kali.

Is there an online DIRB tool?

There is no official online version of DIRB. Run it locally on Kali or macOS, or use a Kali VM. Any website calling itself an online DIRB is not the DIRB project.

Is using DIRB illegal?

DIRB itself is legal software. Scanning a web server without the owner's permission can break the law, so only test systems you own or have written authorization to assess.

How do I use DIRB with a custom wordlist?

Make a text file with one entry per line, then pass the file as the second positional argument, right after the URL: dirb http://127.0.0.1:8080 ./paths.txt.

Why does DIRB find nothing on my target?

If the scan finished normally, the wordlist may not contain the names your app uses. Check that the base URL loads in your browser, then try a more relevant or larger list, or add extensions that fit your lab app with -X.

How do I make DIRB faster?

DIRB is single-threaded and has no flag to add threads. Use small.txt, add -r to skip recursion, or start at the specific lab path you need to check. If you need concurrent requests, try Gobuster or FFUF.

What is the difference between DIRB -X and -M?

For a word like login, -X .php,.html tries login.php and login.html; it does not filter hits by extension. -M tries variants only after a file is found, such as login.php~ when ~ is in the variation list: dirb http://127.0.0.1:8080 -M "~,.tmp,.old,.backup".

Tags

#web-application#directory-bruteforce#content-discovery#fuzzing#reconnaissance

Output Explanation

In the sample, the ==> DIRECTORY line marks /admin/ as a likely directory, and DIRB looks inside it while recursion is on. CODE:200 on /login.php means the server sent a successful response — not that DIRB confirmed a real login page. CODE:403 on /server-status means access was denied; it does not prove the path contains sensitive content. CODE:301 on /test means a permanent redirect, while CODE:302 would mean a temporary one. SIZE is the response body length in bytes, so an error page can still have a nonzero size. Before counting any 200 as a hit, compare its response with a random missing path in the same part of the app: if both show the same missing-page template, the 200 is likely a soft 404. If the scan finishes normally with no hits, none of the tried names produced a recognized match — try a larger wordlist or extensions that fit the lab app.

Ethical Usage Notice

This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.