Skip to content

dnstwist Executor

Category: Discovery and Reconnaissance Script: dnstwist.py Integration: CLI Faraday Plugin: Raw JSON Website: elceef/dnstwist

Description

Runs dnstwist against a domain to find lookalike (typosquat) domains and imports each one into Faraday as a host with a "Lookalike / typo-squat domain" vulnerability.

Prerequisites

  • dnstwist installed and available in the agent's PATH (checked with dnstwist --version)
  • Network access for DNS lookups

Configuration

Environment Variables (Setup)

This executor does not require setup environment variables.

Execution Arguments

Parameter Type Mandatory Description
DNSTWIST_DOMAIN string Yes Domain to generate lookalikes for (e.g., example.com)
DNSTWIST_REGISTERED_ONLY boolean No Only report permutations that resolve (are registered) (default: true). Set to false to report every generated permutation.
DNSTWIST_MX_CHECK boolean No Also check whether each lookalike domain has mail (MX) records (default: false)

YAML Configuration Example

executors:
  dnstwist:
    repo_executor: dnstwist.py
    max_size: 65536
    varenvs: {}
    params:
      DNSTWIST_DOMAIN:
        mandatory: true
        type: string
        base: string
      DNSTWIST_REGISTERED_ONLY:
        mandatory: false
        type: boolean
        base: boolean
      DNSTWIST_MX_CHECK:
        mandatory: false
        type: boolean
        base: boolean

How It Works

  1. Runs dnstwist --format json on DNSTWIST_DOMAIN, adding --registered unless DNSTWIST_REGISTERED_ONLY is false and --mxcheck when DNSTWIST_MX_CHECK is true
  2. Creates one host per permutation, using its first resolved IP address and the domain as hostname
  3. Adds a "Lookalike / typo-squat domain" vulnerability to each host. The description has the permutation technique (fuzzer), the DNS A and MX records and the registrar.
  4. Sets severity to high when the lookalike has MX records (it can send or receive mail) and medium otherwise

Notes

  • Permutations that do not resolve (only possible when DNSTWIST_REGISTERED_ONLY is false) use IP 0.0.0.0.
  • The run fails if DNSTWIST_DOMAIN is missing or if dnstwist does not return valid JSON.
  • Severity depends on MX records, so DNSTWIST_MX_CHECK should be true if you want mail-capable lookalikes flagged as high.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor.