Webcast 114180
Webcast 114180
• Welcome to my talk!
• A copy of these slides are available on https://ericconrad.com
• This talk will not debate the merits of encrypted DNS vs.
traditional DNS via UDP/TCP port 53 (sometimes called Do53)
o Encrypted DNS provides privacy to the end user
o Do53 provides easy centralized monitoring for companies, ISPs, etc.
• And easy monetization for ISPs
• Years of network defense have taught me to be a realist, and
not fight the incoming tide
• DNS over HTTPS (DoH) is coming on like a freight train
o Network defenders need to prepare accordingly
Threat Hunting via DNS 6
DNS over HTTPS (DoH) and DNS over TLS (DoT)
• DNS over HTTPS (DoH) and DNS over TLS (DoT) are impacting the ability to monitor
DNS queries
o This is true for Intrusion Detection Systems such as Zeek, as well as logging requests on the local
DNS resolver/forwarder
• DNS over HTTPS uses TCP port 443 and looks like normal HTTPS traffic from a
network perspective
• DNS over TLS uses TCP port 853, so network operators/defenders know that it’s
(encrypted) DNS traffic
o DoT can be easily blocked by a firewall, forcing resolution back to DNS
• In both cases: analyzing the content on the wire requires SSL/TLS
interception/decryption
• The early trend: browsers tend to support DNS over HTTPS (for
resolution within the browser), while Linux operating systems tend to
support DNS over TLS for default operating system resolution
o DNS over TLS is now used by default by Android (called “Private DNS Mode”)
• Firefox bypasses the local system DNS settings when using DoH, and
sets the DNS provider to Cloudflare by default
o Other options include NextDNS and Custom
o This bypass policy has proven to be controversial
• Chrome uses a different approach: If the system is using a provider on
this list for DNS resolution, Chrome will “auto-upgrade” the DNS
setting from DNS to DoH, and keep the same provider:
o Cleanbrowsing, Cloudflare, Comcast, DNS.SB, Google, OpenDNS, Quad9
o Otherwise: Chrome will continue using regular DNS, and the existing provider
Do53 Do53
Log locally
here
Threat Hunting via DNS 15
Third-Party DoH Architectural Diagram
No network
analysis without
TLS interception
Google,
Cloudflare,
Quad9, etc.
Threat Hunting via DNS 16
Custom DoH Architectural Diagram
Sniff here,
analyze
with Zeek
DoH Do53
Log locally
here
Threat Hunting via DNS 17
Disabling DoH in Firefox and Chrome
Firefox: Chrome:
• To disable Firefox DoH for the • There is no canary domain
enterprise: do not allow this support
canary domain to resolve: use- • If using a supported DNS
application-dns.net provider, Chrome will auto-
• To disable DoH in a browser, go upgrade any Do53 connection to
to Settings -> Network Settings - DoH
> Connection settings, and • Workaround: if you don't use a
uncheck “Enable DNS over supported DNS provider, Chrome
HTTPS” will use Do53
• DoH is HTTPS
o Uses web servers such as Nginx and Apache, leverages x.509 certs, etc.
• For example:
o https://dns.zez.me – regular HTTPS site
o https://dns.zez.me/dns-query - resolves DoH requests via a POST
adf
Image:
C:\WINDOWS\SYSTEM32\PING.EXE
Note the large DNS TXT records used by the Zeus botnet for
Command and Control (C2):
Though DGA detection can be very effective, think more broadly about
places where adversaries might programmatically generate large volumes
Detecting randomness can be a tremendous indicator of otherwise
unknown malice
• Thread/Process names • Subdomains (Domain Shadowing1)
• File names (binaries, scripts, etc.) • Certificate subject names and issuers
• Workstation names • Usernames
• Service names • Many additional possibilities