Skip to main content

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 URL
  • max_workers: Number of concurrent scanning threads
  • timeout: Request timeout in seconds

🛡 Security Considerations

  • Always get permission before scanning websites
  • Respect robots.txt and 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!

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)

Source distribution for dirhunter 1.0.0
File Size Uploaded
dirhunter-1.0.0.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dirhunter 1.0.0
File Interpreter ABI Platform
dirhunter-1.0.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page