cybersecurity

Dirb Tool In Kali Linux: Web Directory Scanner Guide

Understanding Dirb in Kali Linux Dirb is a command line web content scanner designed to locate hidden files and directories on web servers using dictionary based brute force attacks. It works by launc

Dirb Tool In Kali Linux: Web Directory Scanner Guide
In this story

Understanding Dirb in Kali Linux

Dirb is a command-line web content scanner designed to locate hidden files and directories on web servers using dictionary-based brute-force attacks. It works by launching systematic HTTP requests against a target URL using a wordlist of common paths, analyzing response codes like 200 OK or 403 Forbidden to map out unlinked server assets. Security professionals rely on it during early web reconnaissance to uncover forgotten administrative panels, backup archives, and configuration files.

If you're conducting authorized penetration testing or bug bounty research, mastering this utility gives you a reliable method for discovering forgotten attack surfaces. Because it comes pre-installed on Kali Linux, you can start scanning targets immediately without compiling source code or hunting down external dependencies.

Core Mechanics and Workflow

The utility operates by appending words from a text dictionary to a base URL. For each generated path, it evaluates the server's response code:

  • 200 OK: The resource exists and is directly accessible.
  • 301/302 Redirect: The path exists but redirects elsewhere, often pointing to an authentication gate.
  • 403 Forbidden: The directory or file exists on the server, but access is restricted.
  • 404 Not Found: The resource does not exist under that name.

Unlike automated vulnerability scanners that parse application code for specific flaws, this tool focuses strictly on content discovery. It finds what's there, leaving the security assessment of those files up to you. Additional journalism by Bloomberg delves into similar views on this issue.

Basic Execution and Syntax

The standard syntax requires a target URL followed optionally by a custom wordlist path. If you omit the wordlist argument, the scanner defaults to its built-in dictionary located at /usr/share/dirb/wordlists/common.txt.

To run a basic scan against a local lab environment using the default dictionary, open your terminal and execute:

dirb http://192.168.1.100/

If you want to supply a specific wordlist from the system repository, you pass it as the second argument:

dirb http://192.168.1.100/ /usr/share/wordlists/dirb/big.txt

The terminal prints discovered paths in real time, showing the URL, HTTP response code, and content size for each valid hit.

Advanced Command Options

Real-world web targets often require tuning your scans to avoid triggering rate limits, bypass basic authentication, or handle specific file formats. The utility provides several flags to modify its behavior:

  • -o: Saves the scan output directly to a text file for reporting. Example: dirb [http://example.com](http://example.com) -o results.txt.
  • -r: Disables recursive scanning, preventing the tool from automatically diving into every subdirectory it discovers.
  • -X: Appends specific file extensions to every word in the dictionary, such as .php or .bak. Example: dirb [http://example.com](http://example.com) -X .php,.html.
  • -z: Adds a millisecond delay between requests to reduce server load and maintain stealth. Example: dirb [http://example.com](http://example.com) -z 100.
  • -p: Routes your traffic through an HTTP proxy, such as an intercepting proxy on 127.0.0.1:8080.

Combining these flags allows you to build targeted commands tailored to the application's technology stack. For instance, if you are auditing a PHP application, you can check for source files and save the findings simultaneously:

💡 You might also like: YouTube IP Address: Tracking,
dirb http://target-app.local/ -X .php -o php_scans.txt

Practical Use Cases in Assessments

Security analysts deploy content discovery during several phases of an engagement:

  1. Information Gathering: Mapping out forgotten directories like /test/, /temp/, or old documentation folders that developers left behind.
  2. Finding Admin Portals: Locating hidden management dashboards that lack public hyperlinks on the main page.
  3. Uncovering Backup Files: Searching for compressed archives (.zip, .tar.gz) or database dumps (.sql) left in web-accessible roots.

Common Mistakes to Avoid

Beginners often make errors that result in incomplete scans or accidental service disruptions. Keep these pitfalls in mind:

  • Failing to check permissions: Running web content scanners against production servers without written authorization is illegal. Always stick to designated labs like HackTheBox or environments you explicitly own.
  • Ignoring rate limits: Flooding a fragile web server with high thread counts can cause denial of service. Use the -z flag to introduce delays if you notice response degradation.
  • Using mismatched wordlists: Scanning a Java-based enterprise application with a PHP-specific wordlist wastes time. Match your dictionary choice to the backend technology stack.

Frequently Asked Questions

Is Dirb a vulnerability scanner?

No. It is purely a content discovery tool. It reports whether files or directories exist based on HTTP status codes, but it does not analyze source code for injection flaws or logic bugs.

How do I stop a scan without losing progress?

While a scan runs in your terminal, you can press q to quit safely or use other interactive hotkeys like n to skip the current directory and jump to the next one.

Why am I getting 403 Forbidden on every request?

This usually indicates that the web server or an active Web Application Firewall is blocking automated requests, or the base URL permissions require authentication that your current session lacks.

Can I use custom wordlists from SecLists with Dirb?

Yes. You can supply any newline-delimited text file as an argument. Many testers use large community repositories like SecLists on GitHub to feed specialized discovery lists into the tool.

IC

Written by

Isabella Carter

As a veteran correspondent, Isabella Carter has reported from across the globe, bringing firsthand perspectives to international stories and local issues.

More from cybersecurity