maurosoria/dirsearch

dirsearch是一款用于暴力破解Web服务器上目录和文件的高级命令行工具,支持多线程、递归扫描、代理支持及多种报告格式。用户可以自定义URL目标、扩展名列表、字典设置等参数,进行高效且定制化的Web目录爆破。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

dirsearch
Current Release: v0.3.9 (2019.11.26)

Overview
dirsearch is an advanced command line tool designed to brute force directories and files in webservers.

Installation & Usage
git clone https://github.com/maurosoria/dirsearch.git
cd dirsearch
python3 dirsearch.py -u -e
you can also use this alias to send directly to proxy python3 /path/to/dirsearch/dirsearch.py --http-proxy=localhost:8080

Options
Options:
-h, --help show this help message and exit

Mandatory:
-u URL, --url=URL URL target
-L URLLIST, --url-list=URLLIST
URL list target
-e EXTENSIONS, --extensions=EXTENSIONS
Extension list separated by comma (Example: php,asp)
-E, --extensions-list
Use predefined list of common extensions

Dictionary Settings:
-w WORDLIST, --wordlist=WORDLIST
Customize wordlist (separated by comma)
-l, --lowercase
–suff=SUFFIXES, --suffixes=SUFFIXES
Add custom suffixes to all files, ignores directories
(example.%EXT%%SUFFIX%)
-f, --force-extensions
Force extensions for every wordlist entry
–nd, --no-dot-extensions
Don’t add a ‘.’ character before extensions

General Settings:
–clean-view, --clean-view
-s DELAY, --delay=DELAY
Delay between requests (float number)
-r, --recursive Bruteforce recursively
-R RECURSIVE_LEVEL_MAX, --recursive-level-max=RECURSIVE_LEVEL_MAX
Max recursion level (subdirs) (Default: 1 [only
rootdir + 1 dir])
–suppress-empty, --suppress-empty
–min=MINIMUMRESPONSESIZE
Minimal response length
–max=MAXIMUMRESPONSESIZE
Maximal response length
–scan-subdir=SCANSUBDIRS, --scan-subdirs=SCANSUBDIRS
Scan subdirectories of the given -u|–url (separated
by comma)
–exclude-subdir=EXCLUDESUBDIRS, --exclude-subdirs=EXCLUDESUBDIRS
Exclude the following subdirectories during recursive
scan (separated by comma)
-t THREADSCOUNT, --threads=THREADSCOUNT
Number of Threads
-i INCLUDESTATUSCODES, --include-status=INCLUDESTATUSCODES
Show only included status codes, separated by comma
(example: 301, 500)
-x EXCLUDESTATUSCODES, --exclude-status=EXCLUDESTATUSCODES
Exclude status code, separated by comma (example: 301,
500)
–exclude-texts=EXCLUDETEXTS
Exclude responses by texts, separated by comma
(example: “Not found”, “Error”)
–exclude-regexps=EXCLUDEREGEXPS
Exclude responses by regexps, separated by comma
(example: “Not foun[a-z]{1}”, “^Error$”)
-c COOKIE, --cookie=COOKIE
–ua=USERAGENT, --user-agent=USERAGENT
-F, --follow-redirects
-H HEADERS, --header=HEADERS
Headers to add (example: --header “Referer:
example.com” --header “User-Agent: IE”)
–random-agents, --random-user-agents

Connection Settings:
–timeout=TIMEOUT Connection timeout
–ip=IP Resolve name to IP address
–proxy=HTTPPROXY, --http-proxy=HTTPPROXY
Http Proxy (example: localhost:8080)
–proxylist=PROXYLIST, --http-proxy-list=PROXYLIST
Path to file containg http proxy servers.
–http-method=HTTPMETHOD
Method to use, default: GET
–max-retries=MAXRETRIES
-b, --request-by-hostname
By default dirsearch will request by IP for speed.
This forces requests by hostname

Reports:
–simple-report=SIMPLEOUTPUTFILE
Only found paths
–plain-text-report=PLAINTEXTOUTPUTFILE
Found paths with status codes
–json-report=JSONOUTPUTFILE
-q, --quiet-mode Disable output to console (only to reports)
Operating Systems supported
Windows XP/7/8/10
GNU/Linux
MacOSX
Features
Multithreaded
Keep alive connections
Support for multiple extensions (-e|–extensions asp,php)
Support for every HTTP method
Reporting (plain text, JSON)
Heuristically detects invalid web pages
Recursive brute forcing
Subdirectories brute forcing
Force extensions
HTTP proxy support
HTTP cookies and headers support
User agent randomization
Batch processing
Request delaying
Quiet mode
Option to force requests by hostname
Option to exclude responses by texts
Option to exclude responses by regexps (example: “Not foun[a-z]{1}”)
Option to remove dot from extension when forcing (–nd, example%EXT% instead of example.%EXT%)
Options to display only items with response length from range (–min & --max)
Option to whitelist response codes (-i 200,500)
Option to blacklist response codes (-x 404,403)
Option to remove output from console (-q, keeps output to files)
Option to add custom suffixes to filenames without dots (–suff .BAK,.old, example.%EXT%%SUFFIX%)
About wordlists
Dictionaries must be text files. Each line will be processed as such, except that the special word %EXT% is used, which will generate one entry for each extension (-e | --extension) passed as an argument.

Example:

example/
example.%EXT%
Passing the extensions “asp” and “aspx” will generate the following dictionary:

example/
example.asp
example.aspx
You can also use -f | --force-extensions switch to append extensions to every word in the wordlists (like DirBuster).

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

python3 dirsearch.py -e php,txt,zip -u https://target
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --recursive -R 2
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --recursive -R 4 --scan-subdirs=/,/wp-content/,/wp-admin/
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --exclude-texts=This,AndThat
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt -H “User-Agent: IE”
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt -t 20
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --random-agents
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --json-report=reports/target.json
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --simple-report=reports/target-paths.txt
python3 dirsearch.py -e php,txt,zip -u https://target -w db/dicc.txt --plain-text-report=reports/target-paths-and-status.json
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.3.8” .
dirsearch this is name the image and v0.3.8 is version

Using dirsearch
For using

docker run -it --rm “dirsearch:v0.3.8” -u target -e php,html,png,js,jpg
target is the site or IP

License
Copyright © Mauro Soria (maurosoria@gmail.com)

License: GNU General Public License, version 2

Contributors
Special thanks for these people.

shelld3v
mzfr
Damian89
Bo0oM
liamosaur
redshark1802
SUHAR1K
FireFart
k2l8m11n2
vlohacks
r0p0s3c
V-Rico
russtone

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值