DirHunter 🕵️♀️
DirHunter is a powerful, flexible directory scanning tool for web application security reconnaissance.
🚀 Features
- Fast concurrent directory scanning
- Customizable live printing
- Advanced filtering
- CLI and programmatic usage
- Detailed scanning results
- Supports various output formats
🛠 Installation
pip install dirhunter
💻 Usage
Command Line Interface
dirhunter --url https://example.com --file wordlist.txt
Advanced scanning options :
dirhunter --url https://example.com --file wordlist.txt --workers 20 --verbose
Programmatic Usage
1. Basic Scanning
from dirhunter import DirHunter
# Simple directory scanning
hunter = DirHunter('https://example.com')
directories = ['admin', 'login', 'dashboard']
results = hunter.scan_directories(directories)
# Print found directories
print("Found Directories:", hunter.found_directories)
2. Live Printing
from dirhunter import DirHunter
from colorama import Fore, Style
def custom_live_print(result):
status_color = (
Fore.GREEN if result['exists'] else
Fore.YELLOW if result.get('status_code') == 'Timeout' else
Fore.RED
)
print(f"{status_color}Checking: {result['url']} "
f"[Status: {result['status_code']}]{Style.RESET_ALL}")
hunter = DirHunter('https://example.com').set_live_print(custom_live_print)
hunter.scan_directories(['admin', 'login', 'dashboard'])
3. Advanced Scanning with Filtering
from dirhunter import DirHunter
from dirhunter.utils import load_wordlist, filter_directories
# Load directories from a wordlist
directories = load_wordlist('large_wordlist.txt')
# Create hunter with custom configuration
hunter = DirHunter(
'https://example.com',
max_workers=20, # Increase concurrency
timeout=3 # Adjust request timeout
)
# Scan and filter results
results = hunter.scan_directories(directories)
interesting_dirs = filter_directories(
results,
status_codes=[200, 403, 301] # Custom status code filtering
)
print("Interesting Directories:", interesting_dirs)
4. Custom Result Processing
from dirhunter import DirHunter
class AdvancedScanner:
def __init__(self, base_url):
self.hunter = DirHunter(base_url)
self.results = []
def scan(self, directories):
def live_handler(result):
if result['exists'] or result['status_code'] == 403:
print(f"Potential Target: {result['url']}")
self.results.append(result)
self.hunter.set_live_print(live_handler)
return self.hunter.scan_directories(directories)
def get_summary(self):
return {
'total_scanned': len(self.results),
'found_directories': [r['url'] for r in self.results if r['exists']]
}
scanner = AdvancedScanner('https://example.com')
scanner.scan(['admin', 'login', 'dashboard'])
print(scanner.get_summary())
🔧 Configuration Options
base_url: Target website URLmax_workers: Number of concurrent scanning threadstimeout: Request timeout in seconds
🛡 Security Considerations
- Always get permission before scanning websites
- Respect
robots.txtand website terms of service - Use responsibly and ethically
📝 License
MIT License
🐛 Reporting Issues
Report issues on the GitHub repository issues page.
🌟 Star the Project
If you find DirHunter useful, please give us a star on GitHub!
Metadata
Release files for dirhunter 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dirhunter-1.0.0.tar.gz | 4.2 kB | Without provenance | Details for dirhunter-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dirhunter-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for dirhunter-1.0.0-py3-none-any.whl |
Total release size: 8.7 kB
Release files / dirhunter-1.0.0.tar.gz
| Download URL | dirhunter-1.0.0.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54a07f7fb62a0e742af2cb700c49624d8adbe3a4c407fff761fb086d7ca50a9c
|
|
BLAKE2b-256 checksum How to use checksums |
cd5b14c00515a4300fbbcb9cad90f89640238ae58cebec329231d27fb09f1704
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|
Release files / dirhunter-1.0.0-py3-none-any.whl
| Download URL | dirhunter-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3fcf330955147e5b4f5834cd82b69a8e84e2664b430bba9983836a0b44880efe
|
|
BLAKE2b-256 checksum How to use checksums |
97f423e240c723aded9ffe4edd0b9c0c9ea2ba09eab529730e25f5a442fb6dba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.2
|
Security for dirhunter 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.