dirsearch1
An advanced command-line tool designed to brute force directories and files in webservers
Usage
dirsearch.py [{-u | --url}]
target
[{-e | --extensions}]
extensions
[options]
Options
-
--version -
show program's version number and exit
-
-h, --help -
show this help message and exit
-
Mandatory:
-
-u URL, --url=URL -
Target URL
-
-l FILE, --url-list=FILE -
Target URL list file
-
--stdin -
Target URL list from STDIN
-
--cidr=CIDR -
Target CIDR
-
--raw=FILE -
Load raw HTTP request from file (use `--scheme` flag to set the scheme)
-
-e EXTENSIONS, --extensions=EXTENSIONS -
Extension list separated by commas (Example: php,asp)
-
-X EXTENSIONS, --exclude-extensions=EXTENSIONS -
Exclude extension list separated by commas (Example: asp,jsp)
-
-f, --force-extensions -
Add extensions to every wordlist entry. By default dirsearch only replaces the %EXT% keyword with extensions
-
Dictionary Settings:
-
-w WORDLIST, --wordlists=WORDLIST -
Customize wordlists (separated by commas)
-
--prefixes=PREFIXES -
Add custom prefixes to all wordlist entries (separated by commas)
-
--suffixes=SUFFIXES -
Add custom suffixes to all wordlist entries, ignore directories (separated by commas)
-
--only-selected -
Remove paths have different extensions from selected ones via `-e` (keep entries don't have extensions)
-
--remove-extensions -
Remove extensions in all paths (Example: admin.php -> admin)
-
-U, --uppercase -
Uppercase wordlist
-
-L, --lowercase -
Lowercase wordlist
-
-C, --capital -
Capital wordlist
-
General Settings:
-
-t THREADS, --threads=THREADS -
Number of threads
-
-r, --recursive -
Brute-force recursively
-
--deep-recursive -
Perform recursive scan on every directory depth (Example: api/users -> api/)
-
--force-recursive -
Do recursive brute-force for every found path, not only paths end with slash
-
-R DEPTH, --recursion-depth=DEPTH -
Maximum recursion depth
-
--recursion-status=CODES -
Valid status codes to perform recursive scan, support ranges (separated by commas)
-
--subdirs=SUBDIRS -
Scan sub-directories of the given URL[s] (separated by commas)
-
--exclude-subdirs=SUBDIRS -
Exclude the following subdirectories during recursive scan (separated by commas)
-
-i CODES, --include-status=CODES -
Include status codes, separated by commas, support ranges (Example: 200,300-399)
-
-x CODES, --exclude-status=CODES -
Exclude status codes, separated by commas, support ranges (Example: 301,500-599)
-
--exclude-sizes=SIZES -
Exclude responses by sizes, separated by commas (Example: 123B,4KB)
-
--exclude-texts=TEXTS -
Exclude responses by texts, separated by commas (Example: 'Not found', 'Error')
-
--exclude-regexps=REGEXPS -
Exclude responses by regexps, separated by commas (Example: 'Not foun[a-z]{1}', '^Error$')
-
--exclude-redirects=REGEXPS -
Exclude responses by redirect regexps or texts, separated by commas (Example: 'https://okta.com/*')
-
--exclude-response=PATH -
Exclude responses by response of this page (path as input)
-
--skip-on-status=CODES -
Skip target whenever hit one of these status codes, separated by commas, support ranges
-
--minimal=LENGTH -
Minimal response length
-
--maximal=LENGTH -
Maximal response length
-
--max-time=SECONDS -
Maximal runtime for the scan
-
-q, --quiet-mode -
Quiet mode
-
--full-url -
Full URLs in the output (enabled automatically in quiet mode)
-
--no-color -
No colored output
-
Request Settings:
-
-m METHOD, --http-method=METHOD -
HTTP method (default: GET)
-
-d DATA, --data=DATA -
HTTP request data
-
-H HEADERS, --header=HEADERS -
HTTP request header, support multiple flags (Example:
-H'Referer: example.com')
-
--header-list=FILE -
File contains HTTP request headers
-
-F, --follow-redirects -
Follow HTTP redirects
-
--random-agent -
Choose a random User-Agent for each request
-
--auth-type=TYPE -
Authentication type (basic, digest, bearer, ntlm)
-
--auth=CREDENTIAL -
Authentication credential (user:password or bearer token)
--user-agent=USERAGENT
--cookie=COOKIE
-
Connection Settings:
-
--timeout=TIMEOUT -
Connection timeout
-
-s DELAY, --delay=DELAY -
Delay between requests
-
--proxy=PROXY -
Proxy URL, support HTTP and SOCKS proxies (Example: localhost:8080, socks5://localhost:8088)
-
--proxy-list=FILE -
File contains proxy servers
-
--replay-proxy=PROXY -
Proxy to replay with found paths
-
--scheme=SCHEME -
Default scheme (for raw request or if there is no scheme in the URL)
-
--max-rate=RATE -
Max requests per second
-
--retries=RETRIES -
Number of retries for failed requests
-
-b, --request-by-hostname -
By default dirsearch requests by IP for speed. This will force dirsearch to request by hostname
-
--ip=IP -
Server IP address
-
--exit-on-error -
Exit whenever an error occurs
-
Reports:
-
-o FILE, --output=FILE -
Output file
-
--format=FORMAT -
Report format (Available: simple, plain, json, xml, md, csv, html)
-
You can change the dirsearch default configurations (default extensions,
timeout, wordlist location, ...) by editing the "/etc/dirsearch/default.conf" file. More information at https://github.com/maurosoria/dirsearch.
Releases
5 releases since Debian 3.0 (Woody); the text changed 3 times.
--auth since Debian 12 (Bookworm);
--auth-type since Debian 12 (Bookworm);
--capital since Debian 12 (Bookworm);
--cidr since Debian 12 (Bookworm);
--data since Debian 12 (Bookworm);
--deep-recursive since Debian 12 (Bookworm);
--delay since Debian 12 (Bookworm);
--exclude-extensions since Debian 12 (Bookworm);
--exclude-redirects since Debian 12 (Bookworm);
--exclude-regexps since Debian 12 (Bookworm);
--exclude-response since Debian 12 (Bookworm);
--exclude-sizes since Debian 12 (Bookworm);
--exclude-status since Debian 12 (Bookworm);
--exclude-subdirs since Debian 12 (Bookworm);
--exclude-texts since Debian 12 (Bookworm);
--exit-on-error since Debian 12 (Bookworm);
--extensions since Debian 12 (Bookworm);
--follow-redirects since Debian 12 (Bookworm);
--force-extensions since Debian 12 (Bookworm);
--force-recursive since Debian 12 (Bookworm);
--format since Debian 12 (Bookworm);
--full-url since Debian 12 (Bookworm);
--header since Debian 12 (Bookworm);
--header-list since Debian 12 (Bookworm);
--help since Debian 12 (Bookworm);
--http-method since Debian 12 (Bookworm);
--include-status since Debian 12 (Bookworm);
--ip since Debian 12 (Bookworm);
--lowercase since Debian 12 (Bookworm);
--max-rate since Debian 12 (Bookworm);
--max-time since Debian 12 (Bookworm);
--maximal since Debian 12 (Bookworm);
--minimal since Debian 12 (Bookworm);
--no-color since Debian 12 (Bookworm);
--only-selected since Debian 12 (Bookworm);
--output since Debian 12 (Bookworm);
--prefixes since Debian 12 (Bookworm);
--proxy since Debian 12 (Bookworm);
--proxy-list since Debian 12 (Bookworm);
--quiet-mode since Debian 12 (Bookworm);
--random-agent since Debian 12 (Bookworm);
--raw since Debian 12 (Bookworm);
--recursion-depth since Debian 12 (Bookworm);
--recursion-status since Debian 12 (Bookworm);
--recursive since Debian 12 (Bookworm);
--remove-extensions since Debian 12 (Bookworm);
--replay-proxy since Debian 12 (Bookworm);
--request-by-hostname since Debian 12 (Bookworm);
--retries since Debian 12 (Bookworm);
--scheme since Debian 12 (Bookworm);
--skip-on-status since Debian 12 (Bookworm);
--stdin since Debian 12 (Bookworm);
--subdirs since Debian 12 (Bookworm);
--suffixes since Debian 12 (Bookworm);
--threads since Debian 12 (Bookworm);
--timeout since Debian 12 (Bookworm);
--uppercase since Debian 12 (Bookworm);
--url since Debian 12 (Bookworm);
--url-list since Debian 12 (Bookworm);
--version since Debian 12 (Bookworm);
--wordlists since Debian 12 (Bookworm);
-C since Debian 12 (Bookworm);
-F since Debian 12 (Bookworm);
-H since Debian 12 (Bookworm);
-L since Debian 12 (Bookworm);
-R since Debian 12 (Bookworm);
-U since Debian 12 (Bookworm);
-X since Debian 12 (Bookworm);
-b since Debian 12 (Bookworm);
-d since Debian 12 (Bookworm);
-e since Debian 12 (Bookworm);
-f since Debian 12 (Bookworm);
-h since Debian 12 (Bookworm);
-i since Debian 12 (Bookworm);
-l since Debian 3.1 (Sarge);
-m since Debian 12 (Bookworm);
-o since Debian 12 (Bookworm);
-q since Debian 3.1 (Sarge);
-r since Debian 12 (Bookworm);
-s since Debian 12 (Bookworm);
-t since Debian 12 (Bookworm);
-u since Debian 12 (Bookworm);
-w since Debian 12 (Bookworm);
-x since Debian 12 (Bookworm).
-c until Debian 4.0 (Etch);
-p until Debian 4.0 (Etch).