Skip to content

DNS C2 - Too much data to encode #2149

@omnifocal

Description

@omnifocal

Describe the bug
DNS C2 on v1.6.8 and v1.6.9 appears to be broken. Generating beacons with the correct steps listed in the official documentation (respecting FQDNs with trailing '.') succeeds, however they are never able to complete a connection. Building the beacon with debug enabled will show that it fails out with a "Too much data to encode" error.

Is it possible that there's a maximum length of domain name that works with DNS C2? If so this isn't reflected in docs.

To Reproduce
Steps to reproduce the behavior:

  1. Start DNS Listener
  2. Generate beacon for DNS listener with debug enabled
  3. Execute beacon
  4. Observe the beacon begin communication with the DNS server, but ultimately fail with "Too much data to encode" before the session is registered.

Expected behavior
The beacon should correctly portion data into the DNS queries without trigging the "Too much data" error. If there is a maximum permitted domain length, it should be reflected in doco (or ideally not permitted by the software).

Screenshots

2026/01/30 17:01:16 dnsclient.go:320: [dns] init msg send failure Too much data to encode
2026/01/30 17:01:16 beacon.go:177: [beacon] dns connection error Too much data to encode
2026/01/30 17:01:16 runner.go:141: Beacon init error: Too much data to encode
2026/01/30 17:01:16 runner.go:127: Reconnect sleep: 1m0s

Desktop (please complete the following information):

  • Beacon OS: Kali Linux (amd64)
  • Server OS: Debian (arm)
  • Client and server both on v1.6.9
  • Same behaviour observed on v1.6.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions