Potentially broken DNS canaries
Describe the bug Potentially broken DNS canaries in the newest version of Sliver.
To Reproduce Steps to reproduce the behavior:
- I setup a new Sliver Server on a DigitalOcean droplet (v1.5.22).
- Configured the DNS entries as outlined here: https://github.com/BishopFox/sliver/wiki/DNS-C2
- Created a new implant with a canary included (--canary option)
- Show the C2 canary domain with canaries on the Sliver command line
- Start the DNS server: dns --domains 1.
. . - Name resolution of the canary domain does not return a value nor does it trigger an alarm
New DNS canary domain dmc6a3x.
According to the sliver.log, the DNS request is seen by the sliver server:
But Sliver is not raising an alarm nor is the domain marked as "burn". Is the failure on my side? I double-checked everything.
Can you try increasing the verbosity of the logs by modifying the server.json config.
INFO[2022-08-25T14:39:15Z] [sliver/server/c2/dns.go:91] Starting DNS listener for [1.redacted.ch.] (canaries: true) ... INFO[2022-08-25T14:39:15Z] [github.com/grpc-ecosystem/[email protected]/logging/logrus/options.go:211] finished unary call with code OK INFO[2022-08-25T14:39:16Z] [github.com/grpc-ecosystem/[email protected]/logging/logrus/options.go:211] finished unary call with code OK INFO[2022-08-25T14:39:23Z] [sliver/server/c2/dns.go:362] 'dmc6a3x.1.redacted.ch.' is subdomain of '1.redacted.ch.' DEBU[2022-08-25T14:39:23Z] [sliver/server/c2/dns.go:345] 'dmc6a3x.1.redacted.ch.' is subdomain of c2 parent '1.redacted.ch.' DEBU[2022-08-25T14:39:23Z] [sliver/server/c2/dns.go:375] [dns] processing req for subdomain = dmc6a3x. DEBU[2022-08-25T14:39:23Z] [sliver/server/c2/dns.go:417] subdata = dmc6a3x DEBU[2022-08-25T14:39:23Z] [sliver/server/c2/dns.go:428] failed to decode subdata with encoders.Base32{} (proto: cannot parse invalid wire-format data) DEBU[2022-08-25T14:39:23Z] [sliver/server/c2/dns.go:428] failed to decode subdata with encoders.Base58{} (proto: cannot parse invalid wire-format data) ERRO[2022-08-25T14:39:23Z] [sliver/server/c2/dns.go:378] [dns] error decoding subdata: invalid dns message DEBU[2022-08-25T14:39:23Z] [sliver/server/c2/dns.go:95] DNS server took 569.426µs
@malmoeb we're not able to reproduce, but canaries can be finicky. Check your DNS configuration and note that resolvers may cache canary records since we cannot include a nonce. This may result in canaries only firing a single time. We set the record TTL to 0 but many resolvers ignore TTLs.
@malmoeb did you ever figure out this issue? I've run into the same errors.
@In3x0rabl3 no, sorry. It was not soo important for me to resolve this issue, so I haven't spent more time with debugging.