Giter VIP home page Giter VIP logo

dirsearch's Introduction

dirsearch logo (light)

dirsearch logo (dark)

dirsearch - Web path discovery

Build License Stars Release Sponsors Discord Twitter

An advanced web path brute-forcer

dirsearch is being actively developed by @maurosoria and @shelld3v

Reach to our Discord server to communicate with the team at best

Table of Contents

Installation & Usage

Requirement: python 3.7 or higher

Choose one of these installation options:

  • Install with git: git clone https://github.com/maurosoria/dirsearch.git --depth 1 (RECOMMENDED)
  • Install with ZIP file: Download here
  • Install with Docker: docker build -t "dirsearch:v0.4.3" . (more information can be found here)
  • Install with PyPi: pip3 install dirsearch or pip install dirsearch
  • Install 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 -e flag.
  • For wordlists without %EXT% (like SecLists), -f | --force-extensions switch 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%

Passing asp and aspx as extensions will generate the following dictionary:

index
index.asp
index.aspx
  • Force extensions:
admin

Passing php and html as extensions with -f/--force-extensions flag will generate the following dictionary:

admin
admin.php
admin.html
admin/
  • Overwrite extensions:
login.html

Passing jsp and jspa as extensions with -O/--overwrite-extensions flag will generate the following dictionary:

login.html
login.jsp
login.jspa

Options

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(s), can use 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       Path to configuration file (Default:
                        'DIRSEARCH_CONFIG' environment variable, otherwise
                        '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-text=TEXTS
                        Exclude responses by text, can use multiple flags
    --exclude-regex=REGEX
                        Exclude responses by regular expression
    --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
    --exit-on-error     Exit whenever an error occurs

  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, can use 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=USER_AGENT
    --cookie=COOKIE

  Connection Settings:
    --timeout=TIMEOUT   Connection timeout
    --delay=DELAY       Delay between requests
    --proxy=PROXY       Proxy URL (HTTP/SOCKS), can use multiple flags
    --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
    --interface=NETWORK_INTERFACE
                        Network interface to use

  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 file

Configuration

By default, config.ini inside your dirsearch directory is used as the configuration file but you can select another file via --config flag or DIRSEARCH_CONFIG environment variable.

# 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 = 25
recursive = False
deep-recursive = False
force-recursive = False
recursion-status = 200-399,401,403
max-recursion-depth = 0
exclude-subdirs = %%ff/,.;/,..;/,;/,./,../,%%2e/,%%2e%%2e/
random-user-agents = False
max-time = 0
exit-on-error = False
# subdirs = /,api/
# include-status = 200-299,401
# exclude-status = 400,500-999
# exclude-sizes = 0b,123gb
# exclude-text = "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,js
force-extensions = False
overwrite-extensions = False
lowercase = False
uppercase = False
capitalization = False
# exclude-extensions = old,log
# prefixes = .,admin
# suffixes = ~,.bak
# wordlists = /path/to/wordlist1.txt,/path/to/wordlist2.txt

[request]
http-method = get
follow-redirects = False
# headers-file = /path/to/headers.txt
# user-agent = MyUserAgent
# cookie = SESSIONID=123

[connection]
timeout = 7.5
delay = 0
max-rate = 0
max-retries = 1
## 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 = False
quiet-mode = False
color = True
show-redirects-history = False

[output]
## Support: plain, simple, json, xml, md, csv, html, sqlite
report-format = plain
autosave-report = True
autosave-report-folder = reports/
# log-file = /path/to/dirsearch.log
# log-file-size = 50000000

How to use

Dirsearch demo

Some examples for how to use dirsearch - those are the most common arguments. If you need all, just use the -h argument.

Simple usage

python3 dirsearch.py -u https://target
python3 dirsearch.py -e php,html,js -u https://target
python3 dirsearch.py -e php,html,js -u https://target -w /path/to/wordlist

Pausing progress

dirsearch 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.

Pausing dirsearch


Recursion

  • Recursive brute-force is brute-forcing continuously the after of found directories. For example, if dirsearch finds admin/, it will brute-force admin/* (* is where it brute forces). To enable this feature, use -r (or --recursive) flag
python3 dirsearch.py -e php,html,js -u https://target -r
  • You can set the max recursion depth with --max-recursion-depth, and status codes to recurse with --recursion-status
python3 dirsearch.py -e php,html,js -u https://target -r --max-recursion-depth 3 --recursion-status 200-399
  • There are 2 more options: --force-recursive and --deep-recursive

    • Force 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 => add a/, a/b/)
  • If there are sub-directories that you do not want to brute-force recursively, use --exclude-subdirs

python3 dirsearch.py -e php,html,js -u https://target -r --exclude-subdirs image/,media/,css/

Threads

The 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 20

Prefixes / Suffixes

  • --prefixes: Add custom prefixes to all entries
python3 dirsearch.py -e php -u https://target --prefixes .,admin,_

Wordlist:

tools

Generated with prefixes:

tools
.tools
admintools
_tools
  • --suffixes: Add custom suffixes to all entries
python3 dirsearch.py -e php -u https://target --suffixes ~

Wordlist:

index.php
internal

Generated with suffixes:

index.php
internal
index.php~
internal~

Blacklist

Inside the db/ 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 add admin.php into db/403_blacklist.txt, whenever you do a scan that admin.php returns 403, it will be filtered from the result.


Filters

Use -i | --include-status and -x | --exclude-status to select allowed and not allowed response status-codes

For more advanced filters: --exclude-sizes, --exclude-texts, --exclude-regexps, --exclude-redirects and --exclude-response

python3 dirsearch.py -e php,html,js -u https://target --exclude-sizes 1B,243KB
python3 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.html

Raw request

dirsearch allows you to import the raw request from a file. The content would be something looked like this:

GET /admin HTTP/1.1
Host: admin.example.com
Cache-Control: max-age=0
Accept: */*

Since there is no way for dirsearch to know what the URI scheme is, you need to set it using the --scheme flag. By default, dirsearch automatically detects the scheme.


Wordlist formats

Supported wordlist formats: uppercase, lowercase, capitalization

Lowercase:

admin
index.html

Uppercase:

ADMIN
INDEX.HTML

Capital:

Admin
Index.html

Exclude extensions

Use -X | --exclude-extensions with an extension list will remove all paths in the wordlist that contains the given extensions

python3 dirsearch.py -u https://target -X jsp

Wordlist:

admin.php
test.jsp

After:

admin.php

Scan sub-directories

  • From 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/

Proxies

dirsearch 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:8080
python3 dirsearch.py -e php,html,js -u https://target --proxy socks5://10.10.0.1:8080
python3 dirsearch.py -e php,html,js -u https://target --proxylist proxyservers.txt

Reports

Supported report formats: simple, plain, json, xml, md, csv, html, sqlite

python3 dirsearch.py -e php -l URLs.txt --format plain -o report.txt
python3 dirsearch.py -e php -u https://target --format html -o target.json

More example commands

cat urls.txt | python3 dirsearch.py --stdin
python3 dirsearch.py -u https://target --max-time 360
python3 dirsearch.py -u https://target --auth admin:pass --auth-type basic
python3 dirsearch.py -u https://target --header-list rate-limit-bypasses.txt

There are more to discover, try yourself!

Support Docker

Install Docker Linux

Install Docker

curl -fsSL https://get.docker.com | bash

To use docker you need superuser power

Build Image dirsearch

To create image

docker build -t "dirsearch:v0.4.3" .

dirsearch is the name of the image and v0.4.3 is the version

Using dirsearch

For using

docker run -it --rm "dirsearch:v0.4.3" -u target -e php,html,js,zip

References

Tips

  • The server has requests limit? That's bad, but feel free to bypass it, by randomizing proxy with --proxy-list
  • Want to find out config files or backups? Try --suffixes ~ and --prefixes .
  • Want to find only folders/directories? Why not combine --remove-extensions and --suffixes /!
  • The mix of --cidr, -F, -q and will reduce most of noises + false negatives when brute-forcing with a CIDR
  • Scan a list of URLs, but don't want to see a 429 flood? --skip-on-status 429 will help you to skip a target whenever it returns 429
  • The server contains large files that slow down the scan? You might want to use HEAD HTTP method instead of GET
  • Brute-forcing CIDR is slow? Probably you forgot to reduce request timeout and request retries. Suggest: --timeout 3 --retries 1

Contribution

We 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! See CONTRIBUTORS.md to know who they are.

Pull requests and feature requests are welcomed

License

Copyright (C) Mauro Soria ([email protected])

License: GNU General Public License, version 2

dirsearch's People

Contributors

0x0d3ad avatar atomiczsec avatar cclauss avatar chowmean avatar drego85 avatar exploide avatar gdattacker-researcher avatar godspeedcurry avatar huyphan avatar its0x08 avatar jxdv avatar kosyan62 avatar laxa avatar liamosaur avatar maurosoria avatar mxcezl avatar noraj avatar notdodo avatar random-robbie avatar ricardojba avatar shahril96 avatar shelld3v avatar sjord avatar tkisason avatar v-rico avatar valentijnscholten avatar wdahlenburg avatar xib3rr4dar avatar xinroom avatar zrquan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dirsearch's Issues

Num of processes running concurrently

The command can make the script work multiple processes running simultaneously
Example

-p PROCESS Num of processes running concurrently, 30 by default
https://github.com/lijiejie/BBScan

There is also a problem connecting to the target
If the target is dead, the script takes a long time to move to another target of the file

New Release

Hi Mauro,
the last reales you've released is the year 2016 (v0.3.7). But since then many improvements have been made, so many commit.

Cuddly can you release a new version? So I put it in BackBox.

Thank you
Andrea

get_terminal_size() under FreeBSD

First, thank you for your work.

Please add FreeBSD to the list of operating systems under which to use _get_terminal_size_linux() function:

diff lib/utils/TerminalSize.py ~/dirsearch.git/trunk/lib/utils/TerminalSize.py
40c40
<     if current_os in ['Linux', 'Darwin', 'FreeBSD'] or current_os.startswith('CYGWIN'):
---
>     if current_os in ['Linux', 'Darwin'] or current_os.startswith('CYGWIN'):
42a43
>         print("default")

Also print("default") on line 43 seems to be a forgotten debug message.

TypeError: 'str' does not support the buffer interface

Error:

Traceback (most recent call last):
  File "./dirsearch.py", line 38, in <module>
    main = Program()
  File "./dirsearch.py", line 34, in __init__
    self.controller = Controller(self.script_path, self.arguments, self.output)
  File "/root/dirsearch/lib/controller/Controller.py", line 135, in __init__
    self.wait()
  File "/root/dirsearch/lib/controller/Controller.py", line 334, in wait
    self.fuzzer.start()
  File "/root/dirsearch/lib/core/Fuzzer.py", line 80, in start
    self.setupScanners()
  File "/root/dirsearch/lib/core/Fuzzer.py", line 59, in setupScanners
    self.scanners[extension] = Scanner(self.requester, self.testFailPath, "." + extension)
  File "/root/dirsearch/lib/core/Scanner.py", line 44, in __init__
    self.setup()
  File "/root/dirsearch/lib/core/Scanner.py", line 61, in setup
    self.dynamicParser = DynamicContentParser(self.requester, firstPath, firstResponse.body, secondResponse.body)
  File "/root/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 14, in __init__
    self.generateDynamicMarks(firstPage, secondPage)
  File "/root/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 31, in generateDynamicMarks
    self.cleanPage = self.removeDynamicContent(firstPage, self.dynamicMarks)
  File "/root/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 94, in removeDynamicContent
    page = re.sub(r'(?s){0}.+{1}'.format(re.escape(prefix), re.escape(suffix)), "{0}{1}".format(prefix.replace('\\', r'\\'), suffix.replace('\\', r'\\')), page)
TypeError: 'str' does not support the buffer interface

SSL hanshake failure

I get this error message some target hosts on kali x86
Linux XXX 3.12-kali1-686-pae #1 SMP Debian 3.12.6-2kali1 (2014-01-06) i686 GNU/Linux
Python3 lib installed and run as sudo.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "dirs3arch.py", line 36, in
main = Program()
File "dirs3arch.py", line 32, in init
self.controller = Controller(self.script_path, self.arguments, self.output)
File "/root/dirs3arch/dirs3arch/lib/controller/Controller.py", line 59, in init
self.wait()
File "/root/dirs3arch/dirs3arch/lib/controller/Controller.py", line 199, in wait
self.fuzzer.start()
File "/root/dirs3arch/dirs3arch/lib/core/Fuzzer.py", line 75, in start
self.testersSetup()
File "/root/dirs3arch/dirs3arch/lib/core/Fuzzer.py", line 54, in testersSetup
self.testers['/'] = NotFoundTester(self.requester, '{0}/'.format(self.testFailPath))
File "/root/dirs3arch/dirs3arch/lib/core/NotFoundTester.py", line 31, in init
if self.testNotFoundStatus():
File "/root/dirs3arch/dirs3arch/lib/core/NotFoundTester.py", line 37, in testNotFoundStatus
response = self.requester.request(self.notFoundPath)
File "/root/dirs3arch/dirs3arch/lib/connection/Requester.py", line 114, in request
assert_same_host=False)
File "/root/dirs3arch/dirs3arch/thirdparty/urllib3/connectionpool.py", line 502, in urlopen
raise SSLError(e)
thirdparty.urllib3.exceptions.SSLError: [Errno 1] _ssl.c:392: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure

Extensions Not Being Appended to Wordlist

Hello. Testing this in Kali with Python v2.7.3, and it appears that the extensions are not being appended. I've just pulled down the latest version as well. The wordlist of "list.txt" contains:

# cat list.txt 
foo
login
admin

This is the command I'm using to run.

# ./dirs3arch.py -u http://127.0.0.1/ -w list.txt -t 1 -e aspx --http-proxy 127.0.0.1:8080
         _ _            _____                  _     
      __| (_)_ __ ___  |___ /    __ _ _ __ ___| |__  
     / _` | | '__/ __|   |_ \   / _` | '__/ __| '_ \ 
    | (_| | | |  \__ \  ___) | | (_| | | | (__| | | |
     \__,_|_|_|  |___/ |____/   \__,_|_|  \___|_| |_|


version 0.2.6

- Searching in: http://127.0.0.1/
- For extensions: aspx
- Number of Threads: 1
- Wordlist size: 3



Scanning directory: 

Task Completed

But, when we look at the Apache logs, we only get the first "you cannot be here" resource with the .aspx extended

[Wed Nov 05 13:17:04 2014] [error] [client 127.0.0.1] File does not exist: /var/www/youCannotBeHere7331
[Wed Nov 05 13:17:04 2014] [error] [client 127.0.0.1] File does not exist: /var/www/youCannotBeHere7331.aspx
[Wed Nov 05 13:17:04 2014] [error] [client 127.0.0.1] File does not exist: /var/www/foo
[Wed Nov 05 13:17:04 2014] [error] [client 127.0.0.1] File does not exist: /var/www/login
[Wed Nov 05 13:17:04 2014] [error] [client 127.0.0.1] File does not exist: /var/www/admin

Scanning a domain on CloudFlare

Hello,
this morning I tried scanning 3 domains using the CDN and SSL certificate of CloudFlare . Scanning always reports the same error:

"CONNECTION TIMEOUT: There was a problem in the request to:

Task Completed "

If you want, you can try using my domain to test: https://www.andreadraghetti.it

I think the problem is that Dirsearch makes a Requests request to the domain IP, the domain name is included in the header. But since it's a CDN, the IP does not contain any data off the site.

I tried to modify the Requester.py code as follows:


                if self.requestByHostname:
                    url = "{0}://{1}:{2}".format(self.protocol, self.host, self.port)
                else:
                    url = "{0}://{1}:{2}".format(self.protocol, self.host, self.port)

and now it works properly.

I do not know why it was decided to scan the IP and not the URL directly. So I avoided doing a Pull Request with code modification.

I leave Mauro the job of intervening, he will know how to work better than me.

Thank you

Request TimeOut In admin directory

scan to the admin directory, it crashed

[09:47:26] Starting: /admin/                                                                                                                                 
Traceback (most recent call last):
  File "dirsearch.py", line 38, in <module>
    main = Program()
  File "dirsearch.py", line 34, in __init__
    self.controller = Controller(self.script_path, self.arguments, self.output)
  File "/opt/dirsearch/lib/controller/Controller.py", line 134, in __init__
    self.wait()
  File "/opt/dirsearch/lib/controller/Controller.py", line 330, in wait
    self.fuzzer.start()
  File "/opt/dirsearch/lib/core/Fuzzer.py", line 80, in start
    self.setupScanners()
  File "/opt/dirsearch/lib/core/Fuzzer.py", line 56, in setupScanners
    self.defaultScanner = Scanner(self.requester, self.testFailPath, "")
  File "/opt/dirsearch/lib/core/Scanner.py", line 44, in __init__
    self.setup()
  File "/opt/dirsearch/lib/core/Scanner.py", line 48, in setup
    firstResponse = self.requester.request(firstPath)
  File "/opt/dirsearch/lib/connection/Requester.py", line 152, in request
    {'message': 'CONNECTION TIMEOUT: There was a problem in the request to: {0}'.format(path)}
lib.connection.RequestException.RequestException: {'message': 'CONNECTION TIMEOUT: There was a problem in the request to: tpbSkYC2y9ec'}

but the site is still ok when i scan restart..

Remove DOT when no-extension

Let's say you want to try aspx,asp and no extension.
When you try this: -e asp,aspx,, it tries, -let's say the current word is service-:

service.asp
service.aspx
service.
service/

You want to look for:

service.asp
service.aspx
service
service/

So these two lines do the trick:
dirsearch/lib/connection/Requester.py file:

if url.endswith('.'):
    url = url[:-1]

I added it before the request: lines 130-131

dirsearch

;)

[WINDOWS] cant parsing and saving to log while complex URL is included.

trying with complex URL to bruteforce app function :

http://sub.sub.sub.domain.net/func/service.dll?fid=415&f=/myfunc/loginverify&checkif=


And for traceback :

Error Log: C:\Users\murray\Downloads\dirsearch-master\dirsearch-master\logs\errors-17-01-17_16-16-37.log

Target: http://sub.sub.sub.domain.net/func/service.dll?fid=415&f=/myfunc/loginverify&checkif=

Traceback (most recent call last):
File "dirsearch.py", line 40, in
main = Program()
File "dirsearch.py", line 34, in init
self.controller = Controller(self.script_path, self.arguments, self.output)
File "C:\Users\murray\Downloads\dirsearch-master\dirsearch-master\lib\controller\Controller.py", line 123, in init
self.setupReports(self.requester)
File "C:\Users\murray\Downloads\dirsearch-master\dirsearch-master\lib\controller\Controller.py", line 232, in setupReports
outputFile)
File "C:\Users\murray\Downloads\dirsearch-master\dirsearch-master\lib\reports\BaseReport.py", line 32, in init
self.open()
File "C:\Users\murray\Downloads\dirsearch-master\dirsearch-master\lib\reports\BaseReport.py", line 43, in open
self.file = open(self.output, 'w+')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\murray\Downloads\dirsearch-master\dirsearch-master\reports\sub.sub.sub.domain.net\func/service._17-01-17_16-16-38'

Fix log path for Debian Package

Hi Mauro,
I'm a developer of BackBox Linux. Remember?! :D

Now the software will automatically generate the log, to create a correctly Debian package would be appropriate that the logs were generated in the user's folder.

Otherwise the script must be executed with the permissions of SUDO. Otherwise it generates the error "Permission denied: '/usr/share/DirSearch/logs".

You can change the log salvage path? In Python you can use: os.path.expanduser ("~")

Thanks
Andrea

Error

Hi, can you help me please to fix this error? Thank you

raceback (most recent call last):
File "./dirsearch.py", line 38, in
main = Program()
File "./dirsearch.py", line 34, in init
self.controller = Controller(self.script_path, self.arguments, self.output)
File "/root/dirsearch/lib/controller/Controller.py", line 134, in init
self.wait()
File "/root/dirsearch/lib/controller/Controller.py", line 330, in wait
self.fuzzer.start()
File "/root/dirsearch/lib/core/Fuzzer.py", line 80, in start
self.setupScanners()
File "/root/dirsearch/lib/core/Fuzzer.py", line 56, in setupScanners
self.defaultScanner = Scanner(self.requester, self.testFailPath, "")
File "/root/dirsearch/lib/core/Scanner.py", line 44, in init
self.setup()
File "/root/dirsearch/lib/core/Scanner.py", line 61, in setup
self.dynamicParser = DynamicContentParser(self.requester, firstPath, firstResponse.body, secondResponse.body)
File "/root/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 14, in init
self.generateDynamicMarks(firstPage, secondPage)
File "/root/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 31, in generateDynamicMarks
self.cleanPage = self.removeDynamicContent(firstPage, self.dynamicMarks)
File "/root/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 94, in removeDynamicContent
page = re.sub(r'(?s)%s.+%s' % (prefix, suffix), '%s%s' % (prefix, suffix), str(page))
File "/usr/lib/python3.5/re.py", line 182, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "/usr/lib/python3.5/re.py", line 293, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/lib/python3.5/sre_compile.py", line 536, in compile
p = sre_parse.parse(p, flags)
File "/usr/lib/python3.5/sre_parse.py", line 834, in parse
raise source.error("unbalanced parenthesis")
sre_constants.error: unbalanced parenthesis at position 14

Recursive switch doesn't seem to work

So I'm not sure exactly what the recursive switch is intended to do, but I though it should start searching in the dirs it finds in the first search. However, it just says "Task Completed" even though a directory is found. The admin directory contains several other files and directories I would like to search automatically. Here's a minimal example i made on my own box.

root@kali:~/tools/dirsearch# python3 /root/tools/dirsearch/dirsearch.py -u localhost -w /usr/share/wordlists/dirb/common.txt -e php -t 10 -r

 _|. _ _  _  _  _ _|_    v0.3.7
(_||| _) (/_(_|| (_| )

Extensions: php | Threads: 10 | Wordlist size: 4614

Error Log: /root/tools/dirsearch/logs/errors-17-08-03_10-59-21.log

Target: localhost

[10:59:21] Starting: 
[10:59:21] 200 -  504B  - /
[10:59:22] 301 -    0B  - /admin  ->  /admin/
[10:59:25] 200 -    2KB - /file
[10:59:28] 200 -    4KB - /packages

Task Completed

Offer the possibility to use language-specific dictionaries

Hello and thank you for this tool!

I was wondering if you could implement a system that would allow us to use dictionaries specific to a language. For example, dirseach could by default work on a common dictionary (with strings like .svn, .git, backup, etc) as well as an English dictionary (with strings like schedule, gallery...), and we could also add an option in the command line (for example, --language ISOCODE) to test for language-specific strings from dictionaries located in the db/ folder (for example, db/dicc_ISOCODE.txt).

Thank you for your answer.

strange report files

When program finished scanning, report file have a big size(for example 15 kb(but actually report have 10-15 lines itself)) and i cant open it with any graphical editor, but when i read report file using cat - it prints normal
OS - GNU/Linux

More useful exception messages

I get some of these:

14.74% - Last request to: pete
Unexpected error:
There was a problem in the request to: led

It would be useful to know more about the nature of the unexpected error. It was a connection timeout or what?

Publish to PyPI

This would make a great addition to PyPI! Please add a setup.py file and publish this project so that it can be installed through pip!

Exception when wordlist has words with spaces

I get this:

98.57% - Last request to: dating-southport
Unexpected error:
There was a problem in the request to: san telmo museoa

98.59% - Last request to: development-play
Unexpected error:
There was a problem in the request to: palacio goikoa

98.86% - Last request to: health-skin-tone
Unexpected error:
There was a problem in the request to: konporta ke

I would except to try for example konporta%20ke instead of throwing and exception.

Exclude by "x in string" instead of exact dirname?

Hey,

Often times you'll get a series of dirnames that return garbage. Sometimes they'll look like:

/offers-orlando/
/offers-mexico/
/offers-newyork/

etc..

What would be the best way to be able to exclude these sorts of directories? I'm opening an issue because I'd like other thoughts. I'm not sure if there should be an exclude by regex or exclude by simply checking for a substring in the path. Thoughts?

Url List required

Hi,
Thanks for this new app, i have a request about it.
May it is possible in the future to see apear a new function as a = Url's list loading...i mean the possibility to load a URL_LIST at the place of a unic url adress, like ;

python dirs3arch.py -u -L=myUrlList.txt -e php ( where "L" is the option for loading the list )

Thank you in advance,

Regards,

Don

Invalid extensions option selects all extensions

If you make the extensions option a string the program doesn't recognise, such as '' or foo, it defaults to running searches for all of the extensions in its list. Is this the intended behaviour or should it fail when given invalid extensions? I'd be happy to implement this fix myself once I know what the intended behaviour is.

Not saved report

If you use the -L sitelist.txt

cat sitelist.txt

site1
site2
site3
site4

ls -Rl reports/

./site1:
-rw-r--r--   154  15-11-13_10-17-36.txt

./site2:
-rw-r--r--  0   15-11-13_10-17-02.txt

./site3:
-rw-r--r--  0  15-11-13_10-11-03.txt

./site4:
-rw-r--r--  0   15-11-13_10-15-12.txt

There remains only site1

TypeError: a bytes-like object is required, not 'str'

Error:

Traceback (most recent call last):
  File "dirsearch.py", line 38, in <module>
    main = Program()
  File "dirsearch.py", line 34, in __init__
    self.controller = Controller(self.script_path, self.arguments, self.output)
  File "dirsearch/lib/controller/Controller.py", line 135, in __init__
    self.wait()
  File "dirsearch/lib/controller/Controller.py", line 334, in wait
    self.fuzzer.start()
  File "dirsearch/lib/core/Fuzzer.py", line 80, in start
    self.setupScanners()
  File "dirsearch/lib/core/Fuzzer.py", line 56, in setupScanners
    self.defaultScanner = Scanner(self.requester, self.testFailPath, "")
  File "dirsearch/lib/core/Scanner.py", line 44, in __init__
    self.setup()
  File "dirsearch/lib/core/Scanner.py", line 61, in setup
    self.dynamicParser = DynamicContentParser(self.requester, firstPath, firstResponse.body, secondResponse.body)
  File "dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 16, in __init__
    self.generateDynamicMarks(firstPage, secondPage)
  File "dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 33, in generateDynamicMarks
    self.cleanPage = self.removeDynamicContent(firstPage, self.dynamicMarks)
  File "dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 96, in removeDynamicContent
    page = re.sub(r'(?s){0}.+$'.format(re.escape(prefix)), prefix.replace('\\', r'\\'), page)
TypeError: a bytes-like object is required, not 'str'

ValueError: invalid literal for int() with base 16: b''

[10:50:52] 301 -    0B  - /admin2/index.php  ->  https://bo0om.ru/admin2/
[10:51:04] 301 -    0B  - /admin_area/index.php  ->  https://bo0om.ru/admin_area/
22.89% - Last request to: admin_setup.phpException in thread Thread-4:
Traceback (most recent call last):
  File "/home/bo0om/soft/dirsearch/thirdparty/requests/packages/urllib3/response.py", line 397, in _update_chunk_length
    self.chunk_left = int(line, 16)
ValueError: invalid literal for int() with base 16: b''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.4/threading.py", line 868, in run
    self._target(*self._args, **self._kwargs)
  File "/home/bo0om/soft/dirsearch/lib/core/Fuzzer.py", line 151, in thread_proc
    status, response = self.scan(path)
  File "/home/bo0om/soft/dirsearch/lib/core/Fuzzer.py", line 110, in scan
    response = self.requester.request(path)
  File "/home/bo0om/soft/dirsearch/lib/connection/Requester.py", line 108, in request
    response = requests.get(url, proxies=proxy, verify=False, allow_redirects=self.redirect, headers=headers, timeout=self.timeout)
  File "/home/bo0om/soft/dirsearch/thirdparty/requests/api.py", line 69, in get
    return request('get', url, params=params, **kwargs)
  File "/home/bo0om/soft/dirsearch/thirdparty/requests/api.py", line 50, in request
    response = session.request(method=method, url=url, **kwargs)
  File "/home/bo0om/soft/dirsearch/thirdparty/requests/sessions.py", line 470, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/bo0om/soft/dirsearch/thirdparty/requests/sessions.py", line 610, in send
    r.content
  File "/home/bo0om/soft/dirsearch/thirdparty/requests/models.py", line 734, in content
    self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
  File "/home/bo0om/soft/dirsearch/thirdparty/requests/models.py", line 657, in generate
    for chunk in self.raw.stream(chunk_size, decode_content=True):
  File "/home/bo0om/soft/dirsearch/thirdparty/requests/packages/urllib3/response.py", line 303, in stream
    for line in self.read_chunked(amt, decode_content=decode_content):
  File "/home/bo0om/soft/dirsearch/thirdparty/requests/packages/urllib3/response.py", line 447, in read_chunked
    self._update_chunk_length()
  File "/home/bo0om/soft/dirsearch/thirdparty/requests/packages/urllib3/response.py", line 401, in _update_chunk_length
    raise httplib.IncompleteRead(line)
http.client.IncompleteRead: IncompleteRead(0 bytes read)

[10:51:43] 301 -    0B  - /adminarea/index.php  ->  https://bo0om.ru/adminarea/

failed to join url path during scanning.

When dirs3arch is used to scan php file, a bug appears. What i'v done,

[all3g@core dirs3arch]$ python3 dirs3arch.py -u http://192.168.1.101/ -e "php" -w ~/sectools/fuzzdb/discovery/wordlists.txt -t 20

This is my wordlist file:

123
phpinfo
core
main
...

dirs3arch fails to get the right url path, and the error url is /123? during scanning.
What we need is /123.php.

HTTP Response as follow:

GET /123? HTTP/1.1
Connection: keep-alive
Accept-Encoding: identity
User-agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36
Host: 192.168.1.101
Cache-Control: max-age=0
Accept-Language: en-us
Keep-Alive: 300

HTTP/1.1 404 Not Found
Date: Sun, 22 Mar 2015 10:05:49 GMT
Server: Apache/2.4.10 (Win32) OpenSSL/1.0.1h PHP/5.4.31
Vary: accept-language,accept-charset
Accept-Ranges: bytes
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
Content-Language: en

--ip has no effect

Hi,

In Requester.py, requests is passed the URL, so specifying an IP address in --ip has no effect. The best method to cover both when IP is supplied and when it is resolved is to call requests with the IP (either supplied or resolved) and specify the host part from the URL in the Host header.

I will send in a PR to fix this shortly.

PEP8 compliance

The project is growing so fast. It would make sense to introduce PEP8 guidelines as a coding standard for the project so that everything is uniform.

What are your thoughts on this?

Keyboard Interrupt

Hi there.

It would be nice to trap for keyboard interrupt, so that an in-process scan can be gracefully aborted.

Great tool.

Thanks.

Publish to Homebrew

Brilliant tool! It would be a great convenience for macOS users if you can publish it to Homebrew.

Multithreading problems

When configured for use multiple threads sometimes doesnt find resources.

It'easy to check. Just launch the program against a web server with known resources and with a medium size dictionary file.

Try it with "-t 1" and with "-t 20" several times. You'll see that "-t 20" option sometimes returns less hits.

Scan multiple sites

hello,I Scan multiple sites at the same time, the tool run error:

Traceback (most recent call last):
  File "dirsearch.py", line 40, in <module>
    main = Program()
  File "dirsearch.py", line 34, in __init__
    self.controller = Controller(self.script_path, self.arguments, self.output)
  File "/root/tools/dirsearch/lib/controller/Controller.py", line 134, in __init__
    self.wait()
  File "/root/tools/dirsearch/lib/controller/Controller.py", line 330, in wait
    self.fuzzer.start()
  File "/root/tools/dirsearch/lib/core/Fuzzer.py", line 80, in start
    self.setupScanners()
  File "/root/tools/dirsearch/lib/core/Fuzzer.py", line 59, in setupScanners
    self.scanners[extension] = Scanner(self.requester, self.testFailPath, "." + extension)
  File "/root/tools/dirsearch/lib/core/Scanner.py", line 44, in __init__
    self.setup()
  File "/root/tools/dirsearch/lib/core/Scanner.py", line 48, in setup
    firstResponse = self.requester.request(firstPath)
  File "/root/tools/dirsearch/lib/connection/Requester.py", line 151, in request
    {'message': 'CONNECTION TIMEOUT: There was a problem in the request to: {0}'.format(path)}
lib.connection.RequestException.RequestException: {'message': 'CONNECTION TIMEOUT: There was a problem in the request to: qsYkJ4xZvPdh.aspx'}

Removed db files?

Is the db/dirbuster/ and other files in the db-directory been removed?

Cache Report Data

Hi. One "Feature Enhancement" would be to cache the reporting output to the file as the directory brute-forcing is taking place. Maybe this could be done after a certain period of time has passed or when a new directory is found?

I noticed that if the application crashes during brute-forcing, you actually lose ALL data within the report files. Although the files are created they are simply empty.

sre_constants.error: unbalanced parenthesis

Hi,
scanning the http://tt-karaj.ir site I get this error:

Target: http://tt-karaj.ir

[09:59:45] Starting: 
Traceback (most recent call last):
  File "dirsearch.py", line 40, in <module>
    main = Program()
  File "dirsearch.py", line 34, in __init__
    self.controller = Controller(self.script_path, self.arguments, self.output)
  File "/home/drego85/Scrivania/Tools/dirsearch/lib/controller/Controller.py", line 130, in __init__
    self.wait()
  File "/home/drego85/Scrivania/Tools/dirsearch/lib/controller/Controller.py", line 323, in wait
    self.fuzzer.start()
  File "/home/drego85/Scrivania/Tools/dirsearch/lib/core/Fuzzer.py", line 80, in start
    self.setupScanners()
  File "/home/drego85/Scrivania/Tools/dirsearch/lib/core/Fuzzer.py", line 56, in setupScanners
    self.defaultScanner = Scanner(self.requester, self.testFailPath, "")
  File "/home/drego85/Scrivania/Tools/dirsearch/lib/core/Scanner.py", line 44, in __init__
    self.setup()
  File "/home/drego85/Scrivania/Tools/dirsearch/lib/core/Scanner.py", line 61, in setup
    self.dynamicParser = DynamicContentParser(self.requester, firstPath, firstResponse.body, secondResponse.body)
  File "/home/drego85/Scrivania/Tools/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 14, in __init__
    self.generateDynamicMarks(firstPage, secondPage)
  File "/home/drego85/Scrivania/Tools/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 31, in generateDynamicMarks
    self.cleanPage = self.removeDynamicContent(firstPage, self.dynamicMarks)
  File "/home/drego85/Scrivania/Tools/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 92, in removeDynamicContent
    page = re.sub(r'(?s)%s.+$' % prefix, prefix, str(page))
  File "/usr/lib/python3.4/re.py", line 179, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "/usr/lib/python3.4/re.py", line 294, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.4/sre_compile.py", line 568, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.4/sre_parse.py", line 765, in parse
    raise error("unbalanced parenthesis")
sre_constants.error: unbalanced parenthesis
```

Reason for Killed

I See Dirsearch Throwing Out Killed on Passing 35MB of Wordlists .

What could be the Reasons of "Killed" Status?

Error when using cookie flag

Not sure this is caused by using the cookie flag, but it is when it happened to crash, this is the error I got:

Traceback (most recent call last):
File "dirs3arch.py", line 36, in
main = Program()
File "dirs3arch.py", line 32, in init
self.controller = Controller(self.script_path, self.arguments, self.output)
File "/root/Desktop/dirs3arch/lib/controller/Controller.py", line 59, in init
self.wait()
File "/root/Desktop/dirs3arch/lib/controller/Controller.py", line 199, in wait
self.fuzzer.start()
File "/root/Desktop/dirs3arch/lib/core/Fuzzer.py", line 75, in start
self.testersSetup()
File "/root/Desktop/dirs3arch/lib/core/Fuzzer.py", line 56, in testersSetup
self.testers[extension] = NotFoundTester(self.requester, '{0}.{1}'.format(self.testFailPath, extension))
File "/root/Desktop/dirs3arch/lib/core/NotFoundTester.py", line 34, in init
self.tester = ContentTester(self.getNotFoundDynamicContentParser())
File "/root/Desktop/dirs3arch/lib/core/NotFoundTester.py", line 41, in getNotFoundDynamicContentParser
return DynamicContentParser(self.requester, self.notFoundPath)
File "/root/Desktop/dirs3arch/thirdparty/sqlmap/DynamicContentParser.py", line 23, in init
self.generateDynamicMarks(firstPage, secondPage)
File "/root/Desktop/dirs3arch/thirdparty/sqlmap/DynamicContentParser.py", line 37, in generateDynamicMarks
self.dynamicMarks += findDynamicContent(firstPage, secondPage)
NameError: global name 'findDynamicContent' is not defined

AUTH Basic authentication

How to Enter User Name and Password in Password
AUTH Basic authentication
dirsearch / thirdparty / requests / auth.py
The script is in the folders
But there is none
Run command

%EXT% in dictionary

Please document somewhere this. It took me half day to realize, I need to add %EXT% on line endings in dictionary file to check extensions. Please...

TypeError: a bytes-like object is required, not 'str'

Error since the latest pull:
[06:07:59] Starting:
Traceback (most recent call last):
File "/root/tools/dirsearch/dirsearch.py", line 38, in
main = Program()
File "/root/tools/dirsearch/dirsearch.py", line 34, in init
self.controller = Controller(self.script_path, self.arguments, self.output)
File "/root/tools/dirsearch/lib/controller/Controller.py", line 135, in init
self.wait()
File "/root/tools/dirsearch/lib/controller/Controller.py", line 334, in wait
self.fuzzer.start()
File "/root/tools/dirsearch/lib/core/Fuzzer.py", line 80, in start
self.setupScanners()
File "/root/tools/dirsearch/lib/core/Fuzzer.py", line 56, in setupScanners
self.defaultScanner = Scanner(self.requester, self.testFailPath, "")
File "/root/tools/dirsearch/lib/core/Scanner.py", line 44, in init
self.setup()
File "/root/tools/dirsearch/lib/core/Scanner.py", line 61, in setup
self.dynamicParser = DynamicContentParser(self.requester, firstPath, firstResponse.body, secondResponse.body)
File "/root/tools/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 14, in init
self.generateDynamicMarks(firstPage, secondPage)
File "/root/tools/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 31, in generateDynamicMarks
self.cleanPage = self.removeDynamicContent(firstPage, self.dynamicMarks)
File "/root/tools/dirsearch/thirdparty/sqlmap/DynamicContentParser.py", line 101, in removeDynamicContent
page = re.sub(r'(?s){0}.+{1}'.format(re.escape(prefix), re.escape(suffix)), "{0}{1}".format(prefix.replace('\', r'\'), suffix.replace('\', r'\')), page)
TypeError: a bytes-like object is required, not 'str'

Scanning specific port

Hi,
Today I tried to scan a server with two different WebServer instances, the first on the standard port 80 and the second on port 8880.

If I try scanning the port that interests me, I specify the port after the url (http://123.456.789.000:8880) it will still be scanned port 80 and not 8880.

You can correct? If you want a IP to do a test privately, please contact me in private.

Thanks
Andrea

Extension Wordlist Suggestion

Hi. I had a suggestion for dirs3arch that would hopefully make it more intuitive and flexible to use.

A problem right now is that dirs3arch requires custom wordlists, due to the %EXT% being included to replace the extension. This is problematic because it increases the size of the wordlists by double, and you can't just quickly download a wordlist to use but have to determine how precisely to use the extension with %EXT%.

Might I suggest using a simple wordlist and leaving it up to the user to append the extension.. for example:

./dirs3arch.py -u 'foo' -w bar -e /,.aspx

This could then append / and then .aspx to the wordlists. This also allows for the default behaviour to NOT have an extension which is nice for REST-style URLs. The potential confusion with this is the explicit inclusion of the . before the aspx. In the fork in my repo I've made some modifications for this (albeit an older version), that allow for this usage but it should be quite simple to implement.

Anyways, thanks for the tool!

Sam

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.