Salta ai contenuti

dnstwist

pip install dnstwist
git clone https://github.com/elceef/dnstwist.git
cd dnstwist
pip install -e .
docker run -it elceef/dnstwist dnstwist example.com
  • Python 3.7+
  • dnspython — DNS resolution
  • requests — HTTP requests
  • urllib3 — URL parsing
  • GeoIP2 database (optional, for geolocation)
dnstwist example.com
dnstwist -r example.com
dnstwist -r --registered example.com
dnstwist -v example.com

Domain names differing by single bit flip in DNS wire format.

dnstwist --bitsquatting example.com

Visually similar characters (e.g., rnm, 0O).

dnstwist --homoglyph example.com

Add characters within domain name.

dnstwist --insertion example.com

Remove single characters from domain.

dnstwist --omission example.com

Double consecutive characters.

dnstwist --repetition example.com

Replace characters with similar ones.

dnstwist --replacement example.com

Swap adjacent characters.

dnstwist --transposition example.com

Replace vowels with other vowels.

dnstwist --vowelswap example.com

Add common TLD variations and prefixes/suffixes.

dnstwist --addition example.com

Add hyphens at various positions.

dnstwist --hyphenation example.com
dnstwist -a example.com
dnstwist -r example.com
dnstwist -r --aaaa example.com
dnstwist -r -ns 8.8.8.8 example.com
dnstwist --registered example.com
dnstwist -r --dnssec example.com
dnstwist -r example.com | grep MX
dnstwist -r --mx example.com
dnstwist -r -mx example.com | head -20
dnstwist -r --geoip example.com
# 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
dnstwist -r --geoip --db /path/to/GeoLite2-City.mmdb example.com
dnstwist -r --ssdeep example.com
dnstwist -r --ssdeep --verify example.com
dnstwist -r --http example.com
dnstwist -r --cert example.com
dnstwist -r --csv example.com > results.csv
dnstwist -r --json example.com > results.json
dnstwist -r example.com > results.txt
dnstwist example.com | cut -d' ' -f1
dnstwist -r example.com | grep -E "^[a-z].*\[" | cut -d' ' -f1
dnstwist -w /path/to/wordlist.txt example.com
dnstwist -w /usr/share/dict/words example.com
dnstwist -w wordlist.txt --dictionary-only example.com
# One word per line
malware
phishing
security
admin
dnstwist -w wordlist.txt -a example.com
dnstwist -r example.com | grep WHOIS
whois examplee.com
dnstwist -r --whois example.com
while true; do
  dnstwist -r --json example.com > check_$(date +%s).json
  sleep 3600  # Check hourly
done
# Add to crontab -e
0 * * * * /usr/local/bin/dnstwist -r --json example.com >> /var/log/dnstwist.log
#!/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
dnstwist -r --json example.com | jq . | sqlite3 dnstwist.db
dnstwist -r --json example.com | jq '.[] | select(.dns_a != null)'
dnstwist -r --json example.com | jq '.[] | {domain, dns_a, dns_aaaa, whois_created}'
dnstwist -r --json example.com | jq '.[] | select(.dns_a != null) | .domain'
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
dnstwist_scan:
  image: python:3.9
  script:
    - pip install dnstwist
    - dnstwist -r --json example.com > results.json
  artifacts:
    paths:
      - results.json
pipeline {
  stages {
    stage('dnstwist Scan') {
      steps {
        sh 'pip install dnstwist'
        sh 'dnstwist -r --json example.com > results.json'
        archiveArtifacts artifacts: 'results.json'
      }
    }
  }
}
dnstwist -r --threads 10 example.com
dnstwist -r --timeout 2 example.com
dnstwist -r -ns 1.1.1.1 example.com
dnstwist -r --no-dnssec example.com
dnstwist -q example.com
dnstwist -r -a --ssdeep --geoip --json example.com > investigation.json
for domain in company.com company.org company.net; do
  echo "=== $domain ==="
  dnstwist -r --registered "$domain"
done
dnstwist -r --csv -a example.com > squatting_report.csv
# Then import into spreadsheet for analysis
dnstwist example.com | wc -l  # Total permutations
dnstwist example.com          # List all potential domains
dnstwist -r example.com | grep -E "\[A\]|\[MX\]" | grep -v "$(dig +short example.com)"
  • Reduce Threads for API Rate Limits: --threads 2 on restricted networks
  • Skip DNS Verification: Remove -r flag for faster enumeration
  • Filter by Permutation Type: Use specific flags instead of -a to 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
# Increase timeout value
dnstwist -r --timeout 5 example.com
# Add delay between requests
dnstwist -r --threads 1 example.com
# Ensure database is in expected location
dnstwist -r --geoip --db ~/GeoLite2-City.mmdb example.com
# Process in chunks instead
split -l 1000 wordlist.txt chunk_
for chunk in chunk_*; do
  dnstwist -w "$chunk" example.com
done
  • 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