DNS Vulnerabilities and Attacks
DNS Vulnerabilities and Attacks
DNS
DNS services Why not centralize DNS?
Hostname to IP address
single point of failure
translation
traffic volume
Host aliasing
distant centralized database
Canonical and alias
maintenance
names
Many names for a single doesn’t scale!
host
Mail server aliasing
Load distribution
Replicated Web servers:
m WIDE Tokyo
e NASA Mt View, CA
f Internet Software C. Palo Alto, CA
(and 17 other locations)
13 root name
servers worldwide
TLD and Authoritative Servers
Top-level domain (TLD) servers: responsible for com, org, net, edu, etc,
and all top-level country domains uk, fr, ca, jp.
Network solutions maintains servers for com TLD
Educause for edu TLD
Authoritative DNS servers: organization’s DNS servers, providing
authoritative hostname to IP mappings for organization’s servers (e.g.,
Web and mail).
Can be maintained by organization or service provider (paid by the
organization)
Local Name Server
Does not strictly belong to hierarchy
Each ISP (residential ISP, company, university) has one
Also called “default name server”
When a host makes a DNS query, query is sent to its local DNS server
Acts as a proxy (cache), forwards query into hierarchy
Iterative and Recursive queriesroot DNS server
fresh copy)
TLD servers typically cached in local name servers
Type=A Type=CNAME
name is hostname name is alias name for some
value is IP address
“canonical” (the real) name
www.ibm.com is really
Type=NS servereast.backup2.ibm.com
value is canonical name
name is domain (e.g.
foo.com)
value is IP address of
authoritative DNS Type=MX
server for this domain
value is name of mailserver
associated with name
DNS protocol, messages
DNS protocol : query and reply messages, both with same
message format
msg header
• identification: 16 bit # for
query, reply to query uses
same #
• flags:
query or reply
recursion desired
recursion available
reply is authoritative
DNS protocol, messages (UDP 53)
RRs in response
to query
records for
authoritative servers
additional “helpful”
info that may be used
Example using Wireshark
Check MX record:
nslookup –type=MX cs.ucf.edu (Under Windows)
dig mx cs.ucf.edu (Under Unix)
Inserting records into DNS
Example: just created startup “Network Utopia”
Register name networkuptopia.com at a registrar (e.g., Network
Solutions)
Need to provide registrar with names and IP addresses of
your authoritative name server (primary and secondary)
Registrar inserts two RRs into the com TLD server:
“bankofamerican.com”, “bankfoamerica.com”, ……
Domain name purchase is cheap!
OS DNS Cache Privacy
Windows OS maintain a local DNS cache
Command “ipconfig/displaydns”
No seq/ack numbers
Inherent DNS Vulnerabilities
Users/hosts typically trust the host-address mapping provided by
DNS
Obvious problems
– Interception of requests or compromise of DNS servers can
result in incorrect or malicious responses
– Solution – authenticated requests/responses
– Defense in depth
Type of DNS attacks
Volumetric Attacks
Exploits
Protocol Abuse
Volumetric Attacks
●
Bogus Domain Attack
– Flooding of the DNS servers with non-existing domain
requests implying recursive function saturation. This attack
consumes resources on the DNS server for the recursion
process and reduces its efficiency in answering legitimate
queries. This attack is sometimes called a NXDOMAIN attack..
Exploits
● Zero-Day Vulnerability
◦ Zero-dayz attacks take advantage of DNS security holes in
software for which no solution is currently available.
●
DNS-based Exploits
●
Attacks exploiting bugs and/ or flaws in DNS services, protocol or
on operating system running DNS services.
●
Protocol Anomalies
●
DNS attacks based on malformed queries intending to crash the
service.
●
DNS Rebinding
●
Combination of javascript and IP subnet discovery in order to
attack local network IP devices through the browser. This attack is
mainly used for discovery of unsafe devices (targeting IoT) on the
network, and for data exfiltration.
Stealth/Slow Drip DoS Attacks
● Sloth Domain Attack
Attacks using queries sent to hacker’s authoritative domain that
very slowly answers requests, just before the time out, to cause
capacity exhaustion on victim’s recursive server.
● Phantom Domain Attack
Attacks targeting DNS resolvers by sending them subdomains for
which the domain server is unreachable, causing saturation of
cache server capacity.
● Subdomain Hijacking
Attack aiming to reuse an existing DNS entry (generally a CNAME)
associated to a public cloud resource that has been suppressed.
● Domain Squatting
Attack using registered domain names with a typo in order to get
capture or redirect legitimate traffic to another web site..
DNS Cache Poisoning
• Basic idea: give DNS servers false records and get it cached
• DNS uses a 16-bit request identifier to pair queries with answers
• Cache may be poisoned when a name server:
– Disregards identifiers
– Has predictable ids
– Accepts unsolicited DNS records
DNS Cache Poisoning Procedure
Eve wants to poison attack an ISP DNS server
Eve transmits a DNS query to this server, which in turn
wrong website
DNS Cache Poisoning Example
DNS resource records (see RFC 1034)
– An “A” record supplies a host IP address
The server is configured to respond with a very short time to live (TTL)
record, preventing the DNS response from being cached.
When the victim browses to the malicious domain, the attacker's DNS
server first responds with the IP address of a server hosting the malicious
client-side code. For instance, they could point the victim's browser to a
website that contains malicious JavaScript or Flash scripts that are
intended to execute on the victim's computer.
However, when the victim's browser runs the script it makes a new DNS
request for the domain, and the attacker replies with a new IP address. For
instance, they could reply with an internal IP address or the IP address of a
target somewhere else on the Internet.
DNS Rebinding Protection
DNS servers in the chain can filter out private IP addresses and loopback
IP addresses:
– External public DNS servers (e.g. OpenDNS) can implement DNS
filtering.
– Local system administrators can configure the organization's local
nameserver(s) to block the resolution of external names into internal
IP addresses. (This has the downside of allowing an attacker to map
the internal address ranges in use.)
●
A firewall (e.g. dnswall), in the gateway or in the local pc, can filter DNS
replies that pass through it, discarding local addresses.
●
Web servers can reject HTTP requests with an unrecognized Host header.
DNS Rebinding Protection
Web browsers can resist DNS rebinding:
– Web browsers can implement DNS pinning:
●
the IP address is locked to the value received in the first DNS
response.
●
This technique may block some legitimate uses of Dynamic DNS,
and may not work against all attacks.
●
However, it is important to fail safe (stop rendering) if the IP
address does change, because using an IP address past the TTL
expiration can open the opposite vulnerability when the IP
address has legitimately changed and the expired IP address
may now be controlled by an attacker.
– The NoScript extension for Firefox includes ABE, a firewall-like
feature inside the browser which in its default configuration prevents
attacks on the local network by preventing external webpages from
accessing local IP addresses.
Domain Name System Security Extensions
Hard-coded with
TLD’s public keys
TLDs serve as
Certificate Authority
DNSSEC Deployment