Skip to content

dirsearch

70 commands

A web path scanner that brute-forces directories and files with smart extension handling, recursion and filtering.

  • content discovery
  • brute force
  • directories

Install dirsearch

sudo apt install dirsearch

Basic Directory Enumeration3

dirsearch -u https://example.com

Performs a standard directory brute-force scan on a single target URL using default settings.

dirsearch -u https://example.com/

Runs a scan ensuring the target URL includes a trailing slash for root directory enumeration.

dirsearch -u https://example.com/admin

Targets a specific subdirectory path to begin the enumeration process.

File Extension Enumeration4

dirsearch -u https://example.com -e php

Scans for files with the specific .php extension along with directories.

dirsearch -u https://example.com -e php,html,js

Enumerates files matching multiple extensions separated by commas.

dirsearch -u https://example.com -e *

Forces the tool to fuzz with all extensions found in the selected wordlist.

dirsearch -u https://example.com -X php

Excludes specific file extensions from the scan results to reduce noise.

Recursive Scanning4

dirsearch -u https://example.com -r

Enables recursive scanning to brute-force subdirectories found during the initial scan.

dirsearch -u https://example.com -r --recursion-depth 3

Limits the recursive scan to a maximum depth of 3 directory levels.

dirsearch -u https://example.com -r --recursion-status 200-399

Only triggers recursion on paths that return status codes between 200 and 399.

Link
dirsearch -u https://example.com --deep-recursive

Forces deep recursion on all found paths regardless of status code heuristics.

Link

Multiple Target Scanning2

dirsearch -l targets.txt

Scans a list of URLs provided in a text file line by line.

Link
dirsearch --stdin

Accepts target URLs piped directly from standard input for pipeline integration.

Link

Wordlist Selection and Customization4

dirsearch -u https://example.com -w /path/to/wordlist.txt

Specifies a custom dictionary file instead of using the built-in default wordlist.

Link
dirsearch -u https://example.com --prefixes .admin

Adds a custom prefix to all wordlist entries during the scan.

Link
dirsearch -u https://example.com --suffixes .bak

Appends a custom suffix to all wordlist entries to find backup files.

Link
dirsearch -u https://example.com --uppercase

Mutates the wordlist to use uppercase characters for case-sensitive servers.

Link

HTTP Methods2

dirsearch -u https://example.com -m POST

Changes the HTTP request method to POST for all enumeration attempts.

Link
dirsearch -u https://example.com -m HEAD

Uses HEAD requests to reduce bandwidth usage while checking for existence.

Link

Authentication Handling2

dirsearch -u https://example.com --auth "user:password"

Uses Basic Authentication credentials for protected endpoints.

Link
dirsearch -u https://example.com --auth-type digest --auth "user:password"

Specifies Digest authentication method instead of the default Basic auth.

Link

Proxy and Burp Integration3

dirsearch -u https://example.com --proxy 127.0.0.1:8080

Routes all traffic through an HTTP proxy like Burp Suite or OWASP ZAP.

Link
dirsearch -u https://example.com --proxy socks5://127.0.0.1:9050

Routes scan traffic through a SOCKS5 proxy such as Tor.

Link
dirsearch -u https://example.com --proxy-auth "user:pass"

Provides credentials for authenticating with an upstream proxy server.

Link

TLS and HTTPS Configuration1

dirsearch -u https://example.com --scheme https

Forces the scanner to use HTTPS if the protocol was not specified in the URL.

Link

Status Code Matching and Filtering3

dirsearch -u https://example.com -i 200,301

Includes only specific status codes (e.g., 200 OK and 301 Redirect) in the output.

Link
dirsearch -u https://example.com -x 404,500

Excludes specific status codes (e.g., 404 Not Found) from the results.

Link
dirsearch -u https://example.com --exclude-status 403,401

An alternative long-form flag to hide Forbidden and Unauthorized responses.

Link

Response Size and Line Filtering4

dirsearch -u https://example.com --exclude-sizes 0B,123B

Filters out responses based on specific content lengths in bytes.

Link
dirsearch -u https://example.com --exclude-text "Not Found"

Excludes responses containing a specific text string in the body.

Link
dirsearch -u https://example.com --minimal 200

Only reports responses that are larger than the specified size in bytes.

Link
dirsearch -u https://example.com --maximal 5000

Only reports responses that are smaller than the specified size in bytes.

Link

Regex Based Filtering2

dirsearch -u https://example.com --exclude-regex "^Error.*quot;

Uses a regular expression to filter out responses matching a specific pattern.

Link
dirsearch -u https://example.com --exclude-redirect "google.com"

Excludes redirects that point to a specific URL or domain pattern.

Link

Threading and Performance Tuning2

dirsearch -u https://example.com -t 50

Increases the number of concurrent threads to 50 to speed up the scan.

Link
dirsearch -u https://example.com --max-rate 10

Limits the scan speed to a maximum of 10 requests per second to avoid rate limiting.

Link

Timeout, Delay, and Retry Control3

dirsearch -u https://example.com --delay 0.5

Adds a half-second delay between requests to be stealthier.

Link
dirsearch -u https://example.com --timeout 10

Sets the maximum time to wait for a server response to 10 seconds.

Link
dirsearch -u https://example.com --retries 3

Retries failed requests up to 3 times before giving up on a path.

Link

Output Formats3

dirsearch -u https://example.com --format json -o report.json

Saves the scan results in a structured JSON file for parsing.

Link
dirsearch -u https://example.com --format csv -o report.csv

Exports the findings to a CSV file for spreadsheet analysis.

Link
dirsearch -u https://example.com --format simple -o report.txt

Saves results in a simple, human-readable text format.

Link

Verbose and Debug Modes3

dirsearch -u https://example.com --quiet

Suppresses the banner and standard output, showing only successful findings.

Link
dirsearch -u https://example.com --full-url

Displays the full URL in the output instead of just the path.

Link
dirsearch -u https://example.com --no-color

Disables colored output, useful for logging to files or terminals without color support.

Link

Automation and Pipeline Usage1

dirsearch -u https://example.com --exit-on-error

Forces the tool to exit immediately if an error occurs, useful in automated scripts.

Link

Web Application Reconnaissance2

dirsearch -u https://example.com --subdirs admin/,backup/,test/

Scans the target wordlist against specific provided subdirectories.

Link
dirsearch -u https://example.com --skip-on-status 429

Skips the current target if a 'Too Many Requests' (429) status is received.

Link

Red Team Web Enumeration3

dirsearch -u https://example.com -r -e php,aspx,jsp --exclude-status 404 --random-agent

A combined command for stealthy, recursive discovery of dynamic application files.

Link
dirsearch -u https://example.com --header "X-Forwarded-For: 127.0.0.1" -e conf,config,bak

Attempts to bypass access controls while hunting for sensitive configuration backups.

Link
dirsearch -u https://example.com -m POST --data "debug=true"

Sends POST requests with specific data payload to trigger debug responses.

Link

Blue Team Exposure Validation2

dirsearch -u https://example.com -w sensitive_files.txt --include-status 200

Validates if a specific list of sensitive files is publicly accessible (Status 200).

Link
dirsearch -u https://example.com --exclude-sizes 0-500 --format json -o internal_audit.json

Generates an audit report of potentially non-empty exposed endpoints.

Link

Advanced and Combined Real World Scans13

dirsearch -u https://example.com -t 100 --random-agent -e php --exclude-status 403,404,500

Aggressive, high-thread php file discovery filtering out common error codes.

Link
dirsearch -u https://example.com --crawl

Enables the experimental crawling mode to discover paths via links in responses.

Link
dirsearch -u https://example.com --remove-extensions

Removes extensions from wordlist entries, useful for modern REST API endpoint discovery.

Link
dirsearch -u https://example.com --overwrite-extensions

Replaces any extensions in the wordlist with the one specified in the -e flag.

Link
dirsearch -u https://example.com --force-extensions

Forces the appending of extensions to every wordlist entry, even if one exists.

Link
dirsearch -u https://example.com --suppress-empty

Hides results that return an empty response body.

Link
dirsearch -u https://example.com --calibration

Performs calibration on non-existent paths to automatically determine filters.

Link
dirsearch -u https://example.com --min-response-size 1000

Filters out any responses smaller than 1KB, often removing default error pages.

Link
dirsearch -u https://example.com --max-response-size 100000

Filters out large responses, useful for skipping large media files.

Link
dirsearch -u https://example.com --request-by-hostname

Forces the tool to request by hostname rather than IP, critical for virtual hosts.

Link
dirsearch -u https://example.com --ip 192.168.1.1

Resolves the target domain to a specific IP address manually.

Link
dirsearch -u https://example.com --exclude-content /error.html

Excludes pages that look like the content of the specified file path.

Link
dirsearch -u https://example.com --raw-http-request /path/to/req.txt

Loads a raw HTTP request from a file to perform scanning with exact headers.

Link