Advanced domain variation generation and testing tool for typosquatting detection.
DomainGenChecker is a comprehensive Python tool that generates domain name variations using sophisticated typosquatting techniques and tests their DNS resolution status. It's designed for security professionals, threat intelligence analysts, and researchers to identify potentially malicious domain registrations.
- Keyboard-based typos: Adjacent key substitutions based on QWERTY layout
- Visual similarity: Character substitutions using visually similar characters
- Character manipulation: Omission, repetition, and substitution
- IDN confusables: International domain name homograph attacks
- Subdomain variations: Common subdomain prefix combinations
- Multiple TLD combinations: Test across various top-level domains
- Asynchronous DNS lookups: Concurrent processing for speed
- Intelligent caching: TTL-based result caching to avoid redundant queries
- Rate limiting: Configurable query throttling to respect DNS servers
- Retry logic: Automatic retry with exponential backoff
- Multiple DNS servers: Support for custom nameservers
- Health checking: Built-in DNS resolver health validation
- Text: Beautiful console output with Rich formatting
- JSON: Structured data for integration with other tools
- CSV: Spreadsheet-compatible format for analysis
- Statistics: Comprehensive reporting and analytics
- Input validation: Robust domain and configuration validation
- Error handling: Graceful handling of DNS failures and timeouts
- Logging: Comprehensive logging with configurable levels
- Configuration: Flexible JSON-based configuration system
- Automated security scanning: CodeQL analysis, dependency scanning, and vulnerability detection
- Secret scanning: GitHub's advanced secret detection with push protection
- Security updates: Automated Dependabot security patches
Modern Python distributions (like Kali Linux, Ubuntu 23.04+, etc.) require virtual environments due to PEP 668 externally-managed environments.
# Clone the repository
git clone https://github.com/srnetadmin/DomainGenCheck.git
cd DomainGenCheck-v2
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # On Linux/macOS
# OR: venv\Scripts\activate # On Windows
# Install DomainGenChecker
pip install -e .
# Verify installation
domaingen --help# Install pipx if not already installed
sudo apt install pipx # On Debian/Ubuntu/Kali
# OR: python3 -m pip install --user pipx
# Clone and install
git clone https://github.com/srnetadmin/DomainGenCheck.git
cd DomainGenCheck-v2
pipx install -e .
# Verify installation
domaingen --helpgit clone https://github.com/srnetadmin/DomainGenCheck.git
cd DomainGenCheck-v2
pip install -e .git clone https://github.com/srnetadmin/DomainGenCheck.git
cd DomainGenCheck-v2
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate
# Install with development dependencies
pip install -e ".[dev]"
# Install pre-commit hooks (optional)
pre-commit install# Activate the virtual environment first
cd DomainGenCheck-v2
source venv/bin/activate
# Then run commands
domaingen --domain example.com
domaingen --file domains.txt# Direct usage (no activation needed)
domaingen --domain example.com
domaingen --file domains.txtπ For comprehensive installation instructions, troubleshooting, and OS-specific guidance, see INSTALL.md
If you see this error:
error: externally-managed-environment
Γ This environment is externally managed
You're on a modern Python distribution. Use the virtual environment method:
python3 -m venv venv
source venv/bin/activate
pip install -e .# Install system dependencies (Ubuntu/Kali/Debian)
sudo apt update
sudo apt install python3-venv python3-pip git
# For development
sudo apt install python3-dev build-essentialv2.1.0 introduces a flag-first CLI interface for clearer, more explicit input handling:
domaingen domains.txt # Auto-detected as file
domaingen example.com --domain # Required explicit flagdomaingen --file domains.txt # Explicit file input
domaingen --domain example.com # Explicit domain input- β
Any file extension works:
.domains,.list,.input,.txt- all supported - β No ambiguity: Clear, explicit input type specification
- β Better UX: Follows standard CLI patterns
- β Enhanced validation: Immediate error feedback
| v2.0.x Command | v2.1.0 Equivalent |
|---|---|
domaingen domains.txt |
domaingen --file domains.txt |
domaingen example.com --domain |
domaingen --domain example.com |
domaingen sites.list |
domaingen --file sites.list |
Note: This is a breaking change. The new explicit flags are required in v2.1.0+.
π Note: If you installed using a virtual environment, make sure to activate it first:
cd DomainGenCheck-v2 source venv/bin/activate # Activate virtual environment
# Single domain analysis
domaingen --domain example.com
# Multiple domains from file
domaingen --file domains.txt
# Custom output format with single domain
domaingen --domain github.com --format json --output results.json
# File input with enhanced performance
domaingen --file domains.txt --concurrent 200 --rate-limit 20
# Generate more variants per domain
domaingen --domain google.com --max-variants 100# Disable specific generation techniques
domaingen --file domains.txt --disable-keyboard-typos --disable-subdomain-variations
# Enable IDN confusable attacks (use with caution)
domaingen --domain example.com --enable-idn-confusables
# Use custom DNS servers
domaingen --file domains.txt --nameservers 8.8.8.8 --nameservers 8.8.8.8
# High verbosity with detailed error reporting
domaingen --domain test.com --verbosity 2 --log-level DEBUG
# Short flags for convenience
domaingen -d example.com -f json --max-variants 50
domaingen -f domains.txt --format csv --output results.csv| Option | Description | Required |
|---|---|---|
--domain, -d |
Single domain name to analyze | One of --domain or --file |
--file, -f |
Path to file containing domains | One of --domain or --file |
| Option | Description | Default |
| --max-variants | Maximum variants per domain | 50 |
| --concurrent | Concurrent DNS queries | 100 |
| --rate-limit | DNS queries per second | 10.0 |
| --timeout | DNS timeout in seconds | 5.0 |
| --format | Output format (text/json/csv) | text |
| --output | Output file path | stdout |
| --verbosity | Output verbosity level (0-3) | 1 |
Create a JSON configuration file for persistent settings:
{
"generator": {
"max_variants_per_domain": 100,
"enable_keyboard_typos": true,
"enable_visual_similarity": true,
"enable_idn_confusables": false
},
"dns": {
"concurrent_limit": 150,
"rate_limit": 15.0,
"timeout": 3.0,
"nameservers": ["8.8.8.8", "1.1.1.1"]
},
"output": {
"format": "json",
"include_statistics": true,
"verbosity": 2
}
}Use with: domaingen --file domains.txt --config config.json
# Analyze a single domain
domaingen --domain example.com
domaingen -d github.com # Short flagCreate a text file with domains to analyze (one per line):
# Target domains for analysis
google.com
github.com
microsoft.com
example.org
Comments (lines starting with #) are ignored.
Supported file extensions: Any extension works with the --file flag:
domaingen --file domains.txt # Standard .txt
domaingen --file sites.list # Custom .list
domaingen --file corporate.domains # Custom .domains
domaingen -f targets.input # Any extension works!βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Domain Resolution Results (150 domains) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Domain β Status β IP Addresses β Response Time β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β googl.com β Resolved β 142.251.46.14 β 0.023s β
β gooogle.com β Resolved β 185.199.108.153 β 0.045s β
β google.co β Resolved β 216.58.194.142 β 0.031s β
β google.cm β Unresolvedβ - β 0.102s β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Statistics:
β’ Total Domains: 150
β’ Resolved: 47 (31.3%)
β’ Unresolved: 98 (65.3%)
β’ Errors: 5 (3.3%)
{
"metadata": {
"timestamp": "2024-01-15 14:30:22",
"total_domains": 150,
"format_version": "2.1"
},
"statistics": {
"resolution_rate": 31.3,
"avg_response_time": 0.045,
"domains_per_second": 25.4
},
"results": [
{
"domain": "googl.com",
"status": "resolved",
"ip_addresses": ["142.251.46.14"],
"response_time": 0.023,
"timestamp": 1705330222.123
}
]
}- Omission:
google.comβgogle.com - Repetition:
google.comβgooogle.com - Substitution:
google.comβgaogle.com
Based on QWERTY keyboard layout proximity:
google.comβfoogle.com(gβf adjacent keys)github.comβgithib.com(uβi adjacent keys)
google.comβg00gle.com(oβ0)microsoft.comβmicrosft.com(oβo)
google.comβmail-google.comgoogle.comβsecure.google.com
google.comβgΠΎΠΎgle.com(Latin o β Cyrillic ΠΎ)
# Maximum performance (be respectful to DNS servers)
domaingen --file domains.txt \\
--concurrent 500 \\
--rate-limit 50 \\
--timeout 2.0 \\
--retries 1# Maximum coverage
domaingen --domain example.com \\
--max-variants 200 \\
--enable-idn-confusables \\
--timeout 10.0 \\
--retries 5- Rate Limiting: Always use appropriate rate limiting to avoid overwhelming DNS servers
- Legal Compliance: Ensure your use case complies with applicable laws and regulations
- Responsible Disclosure: Report identified threats through appropriate channels
- DNS Privacy: Be aware that DNS queries may be logged by DNS providers
git clone https://github.com/srnetadmin/DomainGenCheck.git
cd DomainGenCheck-v2
pip install -e ".[dev]"
pre-commit installpytest tests/ --cov=src --cov-report=htmlblack src/ tests/
isort src/ tests/
flake8 src/ tests/
mypy src/We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- dnspython for DNS resolution
- Rich for beautiful console output
- Click for CLI interface
- Pydantic for data validation
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Security: Report security vulnerabilities via GitHub Security Advisories