Package: dirsearch
dirsearch - Web path discoveryAn advanced web path brute-forcerdirsearchis being actively developed by@maurosoriaand@shelld3vReach to ourDiscord serverto communicate with the team at bestTable of ContentsInstallationWordlistsOptionsConfigurationHow to useSimple usagePausing progressRecursionThreadsPrefixes / SuffixesBlacklistFiltersRaw requestWordlist formatsExclude extensionsScan sub-directoriesProxiesReportsMore example commandsSupport DockerInstall Docker LinuxBuild Image dirsearchUsing dirsearchReferencesTipsContributionLicenseInstallation & UsageRequirement: python 3.7 or higherChoose one of these installation options:Install withgit:git clone https://github.com/maurosoria/dirsearch.git --depth 1(RECOMMENDED)Install with ZIP file:Download hereInstall with Docker:docker build -t "dirsearch:v0.4.3" .(more information can be foundhere)Install with PyPi:pip3 install dirsearchorpip install dirsearchInstall with Kali Linux:sudo apt-get install dirsearch(deprecated)Wordlists (IMPORTANT)Summary:Wordlist is a text file, each line is a path.About extensions, unlike other tools, dirsearch only replaces the%EXT%keyword with extensions from-eflag.For wordlists without%EXT%(likeSecLists),-f | --force-extensionsswitch is required to append extensions to every word in wordlist, as well as the/.To apply your extensions to wordlist entries that have extensions already, use-O|--overwrite-extensions(Note: some extensions are excluded from being overwritted such as.log,.json,.xml, ... or media extensions like.jpg,.png)To use multiple wordlists, you can separate your wordlists with commas. Example:wordlist1.txt,wordlist2.txt.Examples:Normal extensions:index.%EXT%Passingaspandaspxas extensions will generate the following dictionary:index
index.asp
index.aspxForce extensions:adminPassingphpandhtmlas extensions with-f/--force-extensionsflag will generate the following dictionary:admin
admin.php
admin.html
admin/Overwrite extensions:login.htmlPassingjspandjspaas extensions with-O/--overwrite-extensionsflag will generate the following dictionary:login.html
login.jsp
login.jspaOptionsUsage: 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(s), support multiple flags
    -l PATH, --url-file=PATH
                        URL list file
    --stdin             Read URL(s) from STDIN
    --cidr=CIDR         Target CIDR
    --raw=PATH          Load raw HTTP request from file (use `--scheme` flag
                        to set the scheme)
    -s SESSION_FILE, --session=SESSION_FILE
                        Session file
    --config=PATH       Full path to config file, see 'config.ini' for
                        example (Default: config.ini)

  Dictionary Settings:
    -w WORDLISTS, --wordlists=WORDLISTS
                        Customize wordlists (separated by commas)
    -e EXTENSIONS, --extensions=EXTENSIONS
                        Extension list separated by commas (e.g. php,asp)
    -f, --force-extensions
                        Add extensions to the end of every wordlist entry. By
                        default dirsearch only replaces the %EXT% keyword with
                        extensions
    -O, --overwrite-extensions
                        Overwrite other extensions in the wordlist with your
                        extensions (selected via `-e`)
    --exclude-extensions=EXTENSIONS
                        Exclude extension list separated by commas (e.g.
                        asp,jsp)
    --remove-extensions
                        Remove extensions in all paths (e.g. admin.php ->
                        admin)
    --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)
    -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 (e.g.
                        api/users -> api/)
    --force-recursive   Do recursive brute-force for every found path, not
                        only directories
    -R DEPTH, --max-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 (e.g. 200,300-399)
    -x CODES, --exclude-status=CODES
                        Exclude status codes, separated by commas, support
                        ranges (e.g. 301,500-599)
    --exclude-sizes=SIZES
                        Exclude responses by sizes, separated by commas (e.g.
                        0B,4KB)
    --exclude-texts=TEXTS
                        Exclude responses by texts, separated by commas (e.g.
                        'Not found', 'Error')
    --exclude-regex=REGEX
                        Exclude responses by regex (e.g. '^Error$')
    --exclude-redirect=STRING
                        Exclude responses if this regex (or text) matches
                        redirect URL (e.g. '/index.html')
    --exclude-response=PATH
                        Exclude responses similar to response of this page,
                        path as input (e.g. 404.html)
    --skip-on-status=CODES
                        Skip target whenever hit one of these status codes,
                        separated by commas, support ranges
    --min-response-size=LENGTH
                        Minimum response length
    --max-response-size=LENGTH
                        Maximum response length
    --max-time=SECONDS  Maximum runtime for the scan

  Request Settings:
    -m METHOD, --http-method=METHOD
                        HTTP method (default: GET)
    -d DATA, --data=DATA
                        HTTP request data
    --data-file=PATH    File contains HTTP request data
    -H HEADERS, --header=HEADERS
                        HTTP request header, support multiple flags
    --header-file=PATH  File contains HTTP request headers
    -F, --follow-redirects
                        Follow HTTP redirects
    --random-agent      Choose a random User-Agent for each request
    --auth=CREDENTIAL   Authentication credential (e.g. user:password or
                        bearer token)
    --auth-type=TYPE    Authentication type (basic, digest, bearer, ntlm, jwt,
                        oauth2)
    --cert-file=PATH    File contains client-side certificate
    --key-file=PATH     File contains client-side certificate private key
                        (unencrypted)
    --user-agent=USERAGENT
    --cookie=COOKIE

  Connection Settings:
    --timeout=TIMEOUT   Connection timeout
    --delay=DELAY       Delay between requests
    --proxy=PROXY       Proxy URL, support HTTP and SOCKS proxies (e.g.
                        localhost:8080, socks5://localhost:8088)
    --proxy-file=PATH   File contains proxy servers
    --proxy-auth=CREDENTIAL
                        Proxy authentication credential
    --replay-proxy=PROXY
                        Proxy to replay with found paths
    --tor               Use Tor network as proxy
    --scheme=SCHEME     Scheme for raw request or if there is no scheme in the
                        URL (Default: auto-detect)
    --max-rate=RATE     Max requests per second
    --retries=RETRIES   Number of retries for failed requests
    --ip=IP             Server IP address
    --exit-on-error     Exit whenever an error occurs

  Advanced Settings:
    --crawl             Crawl for new paths in responses

  View Settings:
    --full-url          Full URLs in the output (enabled automatically in
                        quiet mode)
    --redirects-history
                        Show redirects history
    --no-color          No colored output
    -q, --quiet-mode    Quiet mode

  Output Settings:
    -o PATH, --output=PATH
                        Output file
    --format=FORMAT     Report format (Available: simple, plain, json, xml,
                        md, csv, html, sqlite)
    --log=PATH          Log fileConfigurationDefault values for dirsearch flags can be edited in the configuration file, by default isconfig.inibut you can select another file with the--configflag# If you want to edit dirsearch default configurations, you can# edit values in this file. Everything after `#` is a comment# and won't be applied[general]threads=25recursive=Falsedeep-recursive=Falseforce-recursive=Falserecursion-status=200-399,401,403max-recursion-depth=0exclude-subdirs=%%ff/,.;/,..;/,;/,./,../,%%2e/,%%2e%%2e/random-user-agents=Falsemax-time=0# subdirs = /,api/# include-status = 200-299,401# exclude-status = 400,500-999# exclude-sizes = 0b,123gb# exclude-texts = "Not found"# exclude-regex = "^403$"# exclude-redirect = "*/error.html"# exclude-response = 404.html# skip-on-status = 429,999[dictionary]default-extensions=php,aspx,jsp,html,jsforce-extensions=Falseoverwrite-extensions=Falselowercase=Falseuppercase=Falsecapitalization=False# exclude-extensions = old,log# prefixes = .,admin# suffixes = ~,.bak# wordlists = /path/to/wordlist1.txt,/path/to/wordlist2.txt[request]httpmethod=getfollow-redirects=False# headers-file = /path/to/headers.txt# user-agent = MyUserAgent# cookie = SESSIONID=123[connection]timeout=7.5delay=0max-rate=0max-retries=1exit-on-error=False## By disabling `scheme` variable, dirsearch will automatically identify the URI scheme# scheme = http# proxy = localhost:8080# proxy-file = /path/to/proxies.txt# replay-proxy = localhost:8000[advanced]crawl=False[view]full-url=Falsequiet-mode=Falsecolor=Trueshow-redirects-history=False[output]## Support: plain, simple, json, xml, md, csv, html, sqlitereport-format=plainautosave-report=True# log-file = /path/to/dirsearch.log# report-output-folder = /path/to/reportsHow to useSome examples for how to use dirsearch - those are the most common arguments. If you need all, just use the-hargument.Simple usagepython3 dirsearch.py -u https://targetpython3 dirsearch.py -e php,html,js -u https://targetpython3 dirsearch.py -e php,html,js -u https://target -w /path/to/wordlistPausing progressdirsearch allows you to pause the scanning progress with CTRL+C, from here, you can save the progress (and continue later), skip the current target, or skip the current sub-directory.RecursionRecursive brute-force is brute-forcing continuously the after of found directories. For example, if dirsearch findsadmin/, it will brute-forceadmin/*(*is where it brute forces). To enable this feature, use-r(or--recursive) flagpython3 dirsearch.py -e php,html,js -u https://target -rYou can set the max recursion depth with--recursion-depth, and status codes to recurse with--recursion-statuspython3 dirsearch.py -e php,html,js -u https://target -r --recursion-depth 3 --recursion-status 200-399There are 2 more options:--force-recursiveand--deep-recursiveForce recursive: Brute force recursively all found paths, not just paths end with/Deep recursive: Recursive brute-force all depths of a path (a/b/c=> adda/,a/b/)If there are sub-directories that you do not want to brute-force recursively, use--exclude-subdirspython3 dirsearch.py -e php,html,js -u https://target -r --exclude-subdirs image/,media/,css/ThreadsThe thread number (-t | --threads) reflects the number of separated brute force processes. And so the bigger the thread number is, the faster dirsearch runs. By default, the number of threads is 25, but you can increase it if you want to speed up the progress.In spite of that, the speed still depends a lot on the response time of the server. And as a warning, we advise you to keep the threads number not too big because it can cause DoS (Denial of Service).python3 dirsearch.py -e php,htm,js,bak,zip,tgz,txt -u https://target -t 20Prefixes / Suffixes--prefixes: Add custom prefixes to all entriespython3 dirsearch.py -e php -u https://target --prefixes .,admin,_Wordlist:toolsGenerated with prefixes:tools
.tools
admintools
_tools--suffixes: Add custom suffixes to all entriespython3 dirsearch.py -e php -u https://target --suffixes ~Wordlist:index.php
internalGenerated with suffixes:index.php
internal
index.php~
internal~BlacklistInside thedb/folder, there are several "blacklist files". Paths in those files will be filtered from the scan result if they have the same status as mentioned in the filename.Example: If you addadmin.phpintodb/403_blacklist.txt, whenever you do a scan thatadmin.phpreturns 403, it will be filtered from the result.FiltersUse-i | --include-statusand-x | --exclude-statusto select allowed and not allowed response status-codesFor more advanced filters:--exclude-sizes,--exclude-texts,--exclude-regexps,--exclude-redirectsand--exclude-responsepython3 dirsearch.py -e php,html,js -u https://target --exclude-sizes 1B,243KBpython3 dirsearch.py -e php,html,js -u https://target --exclude-texts "403 Forbidden"python3 dirsearch.py -e php,html,js -u https://target --exclude-regexps "^Error$"python3 dirsearch.py -e php,html,js -u https://target --exclude-redirects "https://(.*).okta.com/*"python3 dirsearch.py -e php,html,js -u https://target --exclude-response /error.htmlRaw requestdirsearch allows you to import the raw request from a file. The content would be something looked like this:GET/adminHTTP/1.1Host:admin.example.comCache-Control:max-age=0Accept:*/*Since there is no way for dirsearch to know what the URI scheme is, you need to set it using the--schemeflag. By default, dirsearch automatically detects the scheme.Wordlist formatsSupported wordlist formats: uppercase, lowercase, capitalizationLowercase:admin
index.htmlUppercase:ADMIN
INDEX.HTMLCapital:Admin
Index.htmlExclude extensionsUse-X | --exclude-extensionswith an extension list will remove all paths in the wordlist that contains the given extensionspython3 dirsearch.py -u https://target -X jspWordlist:admin.php
test.jspAfter:admin.phpScan sub-directoriesFrom an URL, you can scan a list of sub-directories with--subdirs.python3 dirsearch.py -e php,html,js -u https://target --subdirs /,admin/,folder/Proxiesdirsearch supports SOCKS and HTTP proxy, with two options: a proxy server or a list of proxy servers.python3 dirsearch.py -e php,html,js -u https://target --proxy 127.0.0.1:8080python3 dirsearch.py -e php,html,js -u https://target --proxy socks5://10.10.0.1:8080python3 dirsearch.py -e php,html,js -u https://target --proxylist proxyservers.txtReportsSupported report formats:simple,plain,json,xml,md,csv,html,sqlitepython3 dirsearch.py -e php -l URLs.txt --format plain -o report.txtpython3 dirsearch.py -e php -u https://target --format html -o target.jsonMore example commandscat urls.txt | python3 dirsearch.py --stdinpython3 dirsearch.py -u https://target --max-time 360python3 dirsearch.py -u https://target --auth admin:pass --auth-type basicpython3 dirsearch.py -u https://target --header-list rate-limit-bypasses.txtThere are more to discover, try yourself!Support DockerInstall Docker LinuxInstall Dockercurl-fsSLhttps://get.docker.com|bashTo use docker you need superuser powerBuild Image dirsearchTo create imagedockerbuild-t"dirsearch:v0.4.3".dirsearchis the name of the image andv0.4.3is the versionUsing dirsearchFor usingdockerrun-it--rm"dirsearch:v0.4.3"-utarget-ephp,html,js,zipReferencesComprehensive Guide on Dirsearchby Shubham SharmaComprehensive Guide on Dirsearch Part 2by Shubham SharmaHow to Find Hidden Web Directories with Dirsearchby GeeksforGeeksGUÍA COMPLETA SOBRE EL USO DE DIRSEARCHby ESGEEKSHow to use Dirsearch to detect web directoriesby EHackingdirsearch how toby VK9 SecurityFind Hidden Web Directories with Dirsearchby Wonder How ToBrute force directories and files in webservers using dirsearchby Raj UpadhyayLive Bug Bounty Recon Session on Yahoo (Amass, crts.sh, dirsearch) w/ @TheDawgygby NahamsecDirsearch to find Hidden Web Directoriesby Irfan ShakeelGetting access to 25000 employees detailsby Sahil AhamadBest Tools For Directory Bruteforcingby Shubham GoyalDiscover hidden files & directories on a webserver - dirsearch full tutorialby CYBER BYTESTipsThe server has requests limit? That's bad, but feel free to bypass it, by randomizing proxy with--proxy-listWant to find out config files or backups? Try--suffixes ~and--prefixes .Want to find only folders/directories? Why not combine--remove-extensionsand--suffixes /!The mix of--cidr,-F,-qand will reduce most of noises + false negatives when brute-forcing with a CIDRScan a list of URLs, but don't want to see a 429 flood?--skip-on-status 429will help you to skip a target whenever it returns 429The server contains large files that slow down the scan? Youmightwant to useHEADHTTP method instead ofGETBrute-forcing CIDR is slow? Probably you forgot to reduce request timeout and request retries. Suggest:--timeout 3 --retries 1ContributionWe have been receiving a lot of helps from many people around the world to improve this tool. Thanks so much to everyone who have helped us so far!
SeeCONTRIBUTORS.mdto know who they are.Pull requests and feature requests are welcomedLicenseCopyright (C) Mauro Soria (maurosoria@gmail.com)License: GNU General Public License, version 2