GO KALI FREE

DIRB

Web Application

Beginnermedium risk

DIRB is a web content scanner that looks for existing web objects by launching a dictionary-based attack against a web server. It finds hidden directories, backup files, and other sensitive content.

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

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.

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,.txtTarget specific extensions - Limit the search to files ending with specific file extensions
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

Step-by-Step Guide

  1. 1Specify the IP or domain of the remote web server
  2. 2Initiate the default scanning profile
  3. 3Allow the process to cycle through the entire dictionary
  4. 4Examine the list of identified folders and files
  5. 5Browse to the discovered locations manually to assess their value
  6. 6Substitute larger dictionaries if the initial sweep yields nothing

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.

Key Features

Related Tools

Gobuster

Web Application

Faster multi-threaded directory brute forcer.

FFUF

Web Application

Advanced web fuzzer with powerful filtering.

DirBuster

Web Application

GUI-based directory brute forcer.

Frequently Asked Questions

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 is a legacy tool largely replaced by faster alternatives like ffuf, gobuster, and feroxbuster. It remains useful for beginners due to its simplicity but lacks modern features like recursion and advanced filtering.

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?

The -X flag filters results by file extension: -X .php,.html,.txt to only show files with those extensions.

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.

Why is DIRB so slow?

DIRB is single-threaded, sending one request at a time. Use ffuf or gobuster for multi-threaded, faster scanning.

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.

Tags

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

Output Explanation

Displays the URLs it successfully identifies along with the HTTP reply code. A return of CODE:200 indicates success, while CODE:403 reveals a restricted access area.

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.