dnstwist
Installation
섹션 제목: “Installation”From PyPI
섹션 제목: “From PyPI”pip install dnstwist
From Source
섹션 제목: “From Source”git clone https://github.com/elceef/dnstwist.git
cd dnstwist
pip install -e .
Docker
섹션 제목: “Docker”docker run -it elceef/dnstwist dnstwist example.com
Requirements
섹션 제목: “Requirements”- Python 3.7+
dnspython— DNS resolutionrequests— HTTP requestsurllib3— URL parsingGeoIP2database (optional, for geolocation)
Basic Usage
섹션 제목: “Basic Usage”Simple Permutation Check
섹션 제목: “Simple Permutation Check”dnstwist example.com
Check and Resolve DNS
섹션 제목: “Check and Resolve DNS”dnstwist -r example.com
Extended Output with Registered Domains
섹션 제목: “Extended Output with Registered Domains”dnstwist -r --registered example.com
Verbose Mode
섹션 제목: “Verbose Mode”dnstwist -v example.com
Permutation Types
섹션 제목: “Permutation Types”Bitsquatting
섹션 제목: “Bitsquatting”Domain names differing by single bit flip in DNS wire format.
dnstwist --bitsquatting example.com
Homoglyph Attack
섹션 제목: “Homoglyph Attack”Visually similar characters (e.g., rn → m, 0 → O).
dnstwist --homoglyph example.com
Insertion
섹션 제목: “Insertion”Add characters within domain name.
dnstwist --insertion example.com
Omission
섹션 제목: “Omission”Remove single characters from domain.
dnstwist --omission example.com
Repetition
섹션 제목: “Repetition”Double consecutive characters.
dnstwist --repetition example.com
Replacement
섹션 제목: “Replacement”Replace characters with similar ones.
dnstwist --replacement example.com
Transposition
섹션 제목: “Transposition”Swap adjacent characters.
dnstwist --transposition example.com
Vowel Swap
섹션 제목: “Vowel Swap”Replace vowels with other vowels.
dnstwist --vowelswap example.com
Addition
섹션 제목: “Addition”Add common TLD variations and prefixes/suffixes.
dnstwist --addition example.com
Hyphenation
섹션 제목: “Hyphenation”Add hyphens at various positions.
dnstwist --hyphenation example.com
All Permutation Types
섹션 제목: “All Permutation Types”dnstwist -a example.com
DNS Resolution
섹션 제목: “DNS Resolution”Resolve A Records
섹션 제목: “Resolve A Records”dnstwist -r example.com
Resolve AAAA Records (IPv6)
섹션 제목: “Resolve AAAA Records (IPv6)”dnstwist -r --aaaa example.com
Resolve with Specific Nameserver
섹션 제목: “Resolve with Specific Nameserver”dnstwist -r -ns 8.8.8.8 example.com
Check Registration Status
섹션 제목: “Check Registration Status”dnstwist --registered example.com
Verify DNSSEC
섹션 제목: “Verify DNSSEC”dnstwist -r --dnssec example.com
MX Record Checking
섹션 제목: “MX Record Checking”Detect MX Records
섹션 제목: “Detect MX Records”dnstwist -r example.com | grep MX
Full MX Verification
섹션 제목: “Full MX Verification”dnstwist -r --mx example.com
Mail Server Analysis
섹션 제목: “Mail Server Analysis”dnstwist -r -mx example.com | head -20
GeoIP Lookup
섹션 제목: “GeoIP Lookup”Enable GeoIP Resolution
섹션 제목: “Enable GeoIP Resolution”dnstwist -r --geoip example.com
Download GeoIP2 Database
섹션 제목: “Download GeoIP2 Database”# Requires MaxMind account
curl https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=YOUR_KEY&suffix=tar.gz -o geolite2.tar.gz
tar xzf geolite2.tar.gz
Use Custom GeoIP Database
섹션 제목: “Use Custom GeoIP Database”dnstwist -r --geoip --db /path/to/GeoLite2-City.mmdb example.com
Web Page Similarity Detection
섹션 제목: “Web Page Similarity Detection”Fuzzy Hash Comparison
섹션 제목: “Fuzzy Hash Comparison”dnstwist -r --ssdeep example.com
Detect Phishing Pages
섹션 제목: “Detect Phishing Pages”dnstwist -r --ssdeep --verify example.com
HTTP Banner Grabbing
섹션 제목: “HTTP Banner Grabbing”dnstwist -r --http example.com
HTTPS Certificate Analysis
섹션 제목: “HTTPS Certificate Analysis”dnstwist -r --cert example.com
Output Formats
섹션 제목: “Output Formats”CSV Output
섹션 제목: “CSV Output”dnstwist -r --csv example.com > results.csv
JSON Output
섹션 제목: “JSON Output”dnstwist -r --json example.com > results.json
List Format (Default)
섹션 제목: “List Format (Default)”dnstwist -r example.com > results.txt
Domain Names Only
섹션 제목: “Domain Names Only”dnstwist example.com | cut -d' ' -f1
Registered Domains Only
섹션 제목: “Registered Domains Only”dnstwist -r example.com | grep -E "^[a-z].*\[" | cut -d' ' -f1
Dictionary-Based Generation
섹션 제목: “Dictionary-Based Generation”Add Dictionary Words
섹션 제목: “Add Dictionary Words”dnstwist -w /path/to/wordlist.txt example.com
Generate with Common Dictionary
섹션 제목: “Generate with Common Dictionary”dnstwist -w /usr/share/dict/words example.com
Dictionary-Only Mode
섹션 제목: “Dictionary-Only Mode”dnstwist -w wordlist.txt --dictionary-only example.com
Wordlist Format
섹션 제목: “Wordlist Format”# One word per line
malware
phishing
security
admin
Combine with Permutations
섹션 제목: “Combine with Permutations”dnstwist -w wordlist.txt -a example.com
WHOIS Lookups
섹션 제목: “WHOIS Lookups”Basic WHOIS Query
섹션 제목: “Basic WHOIS Query”dnstwist -r example.com | grep WHOIS
Registrar Information
섹션 제목: “Registrar Information”whois examplee.com
Bulk WHOIS Batch
섹션 제목: “Bulk WHOIS Batch”dnstwist -r --whois example.com
Monitoring and Automation
섹션 제목: “Monitoring and Automation”Run Periodic Checks (Bash Loop)
섹션 제목: “Run Periodic Checks (Bash Loop)”while true; do
dnstwist -r --json example.com > check_$(date +%s).json
sleep 3600 # Check hourly
done
Continuous Monitoring with cron
섹션 제목: “Continuous Monitoring with cron”# Add to crontab -e
0 * * * * /usr/local/bin/dnstwist -r --json example.com >> /var/log/dnstwist.log
Real-Time Monitoring Script
섹션 제목: “Real-Time Monitoring Script”#!/bin/bash
domain="example.com"
baseline=$(dnstwist -r --json "$domain")
while true; do
current=$(dnstwist -r --json "$domain")
if [ "$baseline" != "$current" ]; then
echo "Change detected at $(date)" | mail -s "dnstwist Alert" admin@example.com
baseline="$current"
fi
sleep 300
done
Log Results to Database
섹션 제목: “Log Results to Database”dnstwist -r --json example.com | jq . | sqlite3 dnstwist.db
API and CI Integration
섹션 제목: “API and CI Integration”JSON API Output for Integration
섹션 제목: “JSON API Output for Integration”dnstwist -r --json example.com | jq '.[] | select(.dns_a != null)'
Parse JSON Results
섹션 제목: “Parse JSON Results”dnstwist -r --json example.com | jq '.[] | {domain, dns_a, dns_aaaa, whois_created}'
Filter Registered Domains
섹션 제목: “Filter Registered Domains”dnstwist -r --json example.com | jq '.[] | select(.dns_a != null) | .domain'
GitHub Actions Integration
섹션 제목: “GitHub Actions Integration”name: dnstwist Security Check
on: [schedule]
jobs:
dnstwist:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
- run: pip install dnstwist
- run: dnstwist -r --json example.com > results.json
- uses: actions/upload-artifact@v2
with:
name: dnstwist-results
path: results.json
GitLab CI Integration
섹션 제목: “GitLab CI Integration”dnstwist_scan:
image: python:3.9
script:
- pip install dnstwist
- dnstwist -r --json example.com > results.json
artifacts:
paths:
- results.json
Jenkins Pipeline
섹션 제목: “Jenkins Pipeline”pipeline {
stages {
stage('dnstwist Scan') {
steps {
sh 'pip install dnstwist'
sh 'dnstwist -r --json example.com > results.json'
archiveArtifacts artifacts: 'results.json'
}
}
}
}
Advanced Options
섹션 제목: “Advanced Options”Custom Threads for Parallel Resolution
섹션 제목: “Custom Threads for Parallel Resolution”dnstwist -r --threads 10 example.com
Set DNS Query Timeout
섹션 제목: “Set DNS Query Timeout”dnstwist -r --timeout 2 example.com
Name Server Configuration
섹션 제목: “Name Server Configuration”dnstwist -r -ns 1.1.1.1 example.com
Disable DNSSEC Validation
섹션 제목: “Disable DNSSEC Validation”dnstwist -r --no-dnssec example.com
Quiet Mode (Minimal Output)
섹션 제목: “Quiet Mode (Minimal Output)”dnstwist -q example.com
Typical Workflows
섹션 제목: “Typical Workflows”Complete Phishing Investigation
섹션 제목: “Complete Phishing Investigation”dnstwist -r -a --ssdeep --geoip --json example.com > investigation.json
Monitor High-Risk Domains
섹션 제목: “Monitor High-Risk Domains”for domain in company.com company.org company.net; do
echo "=== $domain ==="
dnstwist -r --registered "$domain"
done
Generate Squatting Report
섹션 제목: “Generate Squatting Report”dnstwist -r --csv -a example.com > squatting_report.csv
# Then import into spreadsheet for analysis
Check Permutations Without Resolution
섹션 제목: “Check Permutations Without Resolution”dnstwist example.com | wc -l # Total permutations
dnstwist example.com # List all potential domains
Find Only Suspicious Registrations
섹션 제목: “Find Only Suspicious Registrations”dnstwist -r example.com | grep -E "\[A\]|\[MX\]" | grep -v "$(dig +short example.com)"
Performance Tips
섹션 제목: “Performance Tips”- Reduce Threads for API Rate Limits:
--threads 2on restricted networks - Skip DNS Verification: Remove
-rflag for faster enumeration - Filter by Permutation Type: Use specific flags instead of
-ato reduce output - Export to CSV Early: Process data in spreadsheet tools rather than terminal
- Batch Multiple Domains: Create script to iterate and append to single JSON
Common Issues
섹션 제목: “Common Issues”DNS Timeout
섹션 제목: “DNS Timeout”# Increase timeout value
dnstwist -r --timeout 5 example.com
Rate Limiting
섹션 제목: “Rate Limiting”# Add delay between requests
dnstwist -r --threads 1 example.com
GeoIP Database Not Found
섹션 제목: “GeoIP Database Not Found”# Ensure database is in expected location
dnstwist -r --geoip --db ~/GeoLite2-City.mmdb example.com
Memory Usage with Large Wordlists
섹션 제목: “Memory Usage with Large Wordlists”# Process in chunks instead
split -l 1000 wordlist.txt chunk_
for chunk in chunk_*; do
dnstwist -w "$chunk" example.com
done
Security Best Practices
섹션 제목: “Security Best Practices”- Responsible Disclosure: Only test domains you own or have authorization for
- Rate Limiting: Respect DNS provider rate limits and ISP policies
- Logging: Enable verbose mode during investigations for audit trails
- Automation Consent: Inform stakeholders of automated monitoring
- Data Privacy: Securely store results containing sensitive information
- Legal Compliance: Verify domain monitoring is within acceptable use policies