Attacks on DNS: Risks of Caching

Similar documents
Attacks on DNS: Risks of Caching. March 21, 2018

Network Attacks. CS Computer Security Profs. Vern Paxson & David Wagner

Network security (DNS caching and DoS)

Network Attacks. CS Computer Security. Once again thanks to Vern Paxson and David Wagner

Weaver. Computer Science 161 Fall Network Security 3

This time. Digging into. Networking. Protocols. Naming DNS & DHCP

More on DNS and DNSSEC

DNSSEC. CS 161: Computer Security Prof. David Wagner. April 11, 2016

Local DNS Attack Lab. 1 Lab Overview. 2 Lab Environment. 2.1 Install and configure the DNS server. SEED Labs Local DNS Attack Lab 1

DNS: Useful tool or just a hammer? Paul DNS-OARC 06 Oct 2013, Phoenix

CSC 574 Computer and Network Security. DNS Security

Securing Internet Communication: TLS

CSE 127: Computer Security Network Security. Kirill Levchenko

CS 161 Computer Security

DNS Review Quiz. Match the term to the description: A. Transfer of authority for/to a subdomain. Domain name DNS zone Delegation C B A

CS 3640: Introduction to Networks and Their Applications

TCP/IP SECURITY GRAD SEC NOV

DNS Security. * pers/dnssec/dnssec.html. IT352 Network Security Najwa AlGhamdi

Outline NET 412 NETWORK SECURITY PROTOCOLS. Reference: Lecture 7: DNS Security 3/28/2016

WEB SECURITY: XSS & CSRF

Domain Name Service. DNS Overview. October 2009 Computer Networking 1

The Application Layer: Sockets, DNS

2008 DNS Cache Poisoning Vulnerability Cairo, Egypt November 2008

shortcut Tap into learning NOW! Visit for a complete list of Short Cuts. Your Short Cut to Knowledge

CSE 565 Computer Security Fall 2018

Implementing DNSSEC with DynDNS and GoDaddy

CS118 Discussion 1A, Week 3. Zengwen Yuan Dodd Hall 78, Friday 10:00 11:50 a.m.

CS519: Computer Networks. Lecture 6: Apr 5, 2004 Naming and DNS

ICS 351: Today's plan. IPv6 routing protocols (summary) HTML HTTP web scripting languages certificates (review) cookies

Domain Name System (DNS) Session-1: Fundamentals. Joe Abley AfNOG Workshop, AIS 2017, Nairobi

DOMAIN NAME SECURITY EXTENSIONS

Domain Name System.

DNS CACHE POISONING LAB

CPSC 441 COMPUTER COMMUNICATIONS MIDTERM EXAM SOLUTION

Wireshark Lab: DNS SOLUTION

Sicurezza dei sistemi e delle reti

Networking Overview. CS Computer Security Profs. Vern Paxson & David Wagner

Progress Report 1. Group RP16. All work done by Ivan Gromov and Andrew McConnell

Securing Internet Communication

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur

Introduction to Network. Topics

Remote DNS Cache Poisoning Attack Lab

Computer Security CS 426

CYBER ATTACKS EXPLAINED: PACKET SPOOFING

Local DNS Attack Lab. 1 Lab Overview. 2 Lab Tasks (Part I): Setting Up a Local DNS Server. SEED Labs Local DNS Attack Lab 1

ICS 351: Today's plan. web scripting languages HTTPS: SSL and TLS certificates cookies DNS reminder

Foundations of Network and Computer Security

DNS Cache Poisoning Looking at CERT VU#800113

Lecture 6 Application Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

DNS Mark Kosters Carlos Martínez {ARIN, LACNIC} CTO

Chapter 2 Application Layer. Lecture 5 DNS. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

Chair for Network Architectures and Services Department of Informatics TU München Prof. Carle. Network Security. Chapter 8

A Security Evaluation of DNSSEC with NSEC Review

EE 122: Network Security

DNS and HTTP. A High-Level Overview of how the Internet works

DNS Pharming Attack Lab

Computer Networks - Midterm

Computer Networks - Midterm

Transaction oriented DNS flow analysis (WIP)

Recent advances in IPv6 insecurities Marc van Hauser Heuse CCC Congress 2010, Berlin Marc Heuse

BIND-USERS and Other Debugging Experiences. Mark Andrews Internet Systems Consortium

CS 3640: Introduction to Networks and Their Applications

Internet Engineering. DNS Message Format. Contents. Robert Elz.

ICS 351: Today's plan. web scripting languages HTTPS: SSL and TLS certificates cookies DNS reminder

CSEN 404 Introduction to Networks. Mervat AbuElkheir Mohamed Abdelrazik. ** Slides are attributed to J. F. Kurose

ECE 435 Network Engineering Lecture 7

OFF-PATH ATTACKS AGAINST PUBLIC KEY INFRASTRUCTURES. Markus Brandt, Tianxiang Dai, Elias Heftrig, Amit Klein, Haya Shulman, Michael Waidner

Network Security Issues, Part 1

CS 161 Computer Security

CS4/MSc Computer Networking. Lecture 3: The Application Layer

DNSSEC DNS SECURITY EXTENSIONS INTRODUCTION TO DNSSEC FOR SECURING DNS QUERIES AND INFORMATION

(DNS, and DNSSEC and DDOS) Geoff Huston APNIC

Privacy. CS Computer Security Profs. Vern Paxson & David Wagner

CSCE 463/612 Networks and Distributed Processing Spring 2018

R (2) Implementation of following spoofing assignments using C++ multi-core Programming a) IP Spoofing b) Web spoofing.

DNS Mark Kosters Carlos Martínez ARIN - LACNIC

Domain Name System (DNS) DNS Fundamentals. Computers use IP addresses. Why do we need names? hosts.txt does not scale. The old solution: HOSTS.

Internet Protocol and Transmission Control Protocol

Detecting Attacks, cont.

Bank Infrastructure - Video - 1

Network Security (and related topics)

Networking Overview. CS 161: Computer Security Prof. Vern Paxson. TAs: Jethro Beekman, Mobin Javed, Antonio Lupher, Paul Pearce & Matthias Vallentin

Next Week. Network Security (and related topics) Project 3 Q/A. Agenda. My definition of network security. Network Security.

The Domain Name System

CSCE 463/612 Networks and Distributed Processing Spring 2018

Agenda. Review DNS Fundamentals DNS Security Summary 1/22

6.033 Computer System Engineering

Wireshark Lab: DNS v7.0

The Anatomy of a Man in the Middle Attack

Remote DNS Cache Poisoning Attack Lab

Advanced Networking. Domain Name System

Advanced Networking. Domain Name System. Purpose of DNS servers. Purpose of DNS servers. Purpose of DNS servers

Computer Security Spring 2010 Paxson/Wagner Notes 3/8. Key Management. 1 Cryptographic Hash Functions. 2 Man-in-the-middle Attacks

Homework Problems. 1. Stallings Problem 2.4 from the Problems section, not the Review Questions. 2. Stallings Problem 2.7.

How to Stay Safe on Public Wi-Fi Networks

Domain Name System (DNS) Session-1: Fundamentals. Computers use IP addresses. Why do we need names? hosts.txt does not scale

NETWORK SECURITY. Ch. 3: Network Attacks

Impersonation. CS 161: Computer Security. Prof. Vern Paxson. TAs: Devdatta Akhawe, Mobin Javed & Matthias Vallentin

(a) Which of these two conditions (high or low) is considered more serious? Justify your answer.

What is the relationship between a domain name (e.g., youtube.com) and an IP address?

Transcription:

Attacks on DNS: Risks of Caching CS 161: Computer Security Prof. David Wagner March 30, 2016

Today Midterm 2 grades available Reminder: Start Project 2, Part 2! Today, DNS: protocol for mapping hostnames to IP addresses, and attacks on DNS.

DNS Overview DNS translates www.google.com to 74.125.25.99 It s a performance-critical distributed database. DNS security is critical for the web. (Same-origin policy assumes DNS is secure.) Analogy: If you don t know the answer to a question, ask a friend for help (who may in turn refer you to a friend of theirs, and so on).

DNS Overview DNS translates www.google.com to 74.125.25.99 It s a performance-critical distributed database. DNS security is critical for the web. (Same-origin policy assumes DNS is secure.) Analogy: If you don t know the answer to a question, ask a friend for help (who may in turn refer you to a friend of theirs, and so on). Security risks: friend might be malicious, communication channel to friend might be insecure, friend might be well-intentioned but misinformed

DNS Lookups via a Resolver Host at xyz.poly.edu wants IP address for eecs.mit.edu local DNS server (resolver) dns.poly.edu 2 root DNS server (. ) 3 TLD DNS server (.edu ) 4 5 Caching heavily used to minimize lookups 1 8 7 6 authoritative DNS server (for mit.edu ) dns.mit.edu requesting host xyz.poly.edu eecs.mit.edu

Security risk #1: malicious DNS server Of course, if any of the DNS servers queried are malicious, they can lie to us and fool us about the answer to our DNS query (In fact, they used to be able to fool us about the answer to other queries, too. We ll come back to that.)

Security risk #2: on-path eavesdropper If attacker can eavesdrop on our traffic we re hosed. Why? We ll see why.

Security risk #3: off-path attacker If attacker can t eavesdrop on our traffic, can he inject spoofed DNS responses? This case is especially interesting, so we ll look at it in detail.

DNS Threats DNS: path-critical for just about everything we do Maps hostnames IP addresses Design only scales if we can minimize lookup traffic o #1 way to do so: caching o #2 way to do so: return not only answers to queries, but additional info that will likely be needed shortly What if attacker eavesdrops on our DNS queries? Then similar to DHCP/TCP, can spoof responses Consider attackers who can t eavesdrop - but still aim to manipulate us via how the protocol functions Directly interacting w/ DNS: dig program on Unix Allows querying of DNS system Dumps each field in DNS responses

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19901 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;eecs.mit.edu. IN A Use Unix dig utility to look up IP address ( A ) for hostname eecs.mit.edu via DNS ;; ANSWER SECTION: eecs.mit.edu. 21600 IN A 18.62.1.6 ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. 11088 IN NS W20NS.mit.edu. mit.edu. 11088 IN NS STRAWB.mit.edu. ;; ADDITIONAL SECTION: STRAWB.mit.edu. 126738 IN A 18.71.0.151 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19901 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;eecs.mit.edu. IN A ;; ANSWER SECTION: eecs.mit.edu. 21600 IN A 18.62.1.6 ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. 11088 IN NS W20NS.mit.edu. mit.edu. 11088 IN NS STRAWB.mit.edu. ;; ADDITIONAL SECTION: STRAWB.mit.edu. 126738 IN A 18.71.0.151 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19901 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;eecs.mit.edu. IN A ;; ANSWER SECTION: eecs.mit.edu. A 16-bit transaction identifier that enables 21600 the DNS IN client A (dig, in this 18.62.1.6 case) to match up the reply with its original request ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. 11088 IN NS W20NS.mit.edu. mit.edu. 11088 IN NS STRAWB.mit.edu. ;; ADDITIONAL SECTION: STRAWB.mit.edu. 126738 IN A 18.71.0.151 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19901 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;eecs.mit.edu. IN A ;; ANSWER SECTION: eecs.mit.edu. 21600 IN A 18.62.1.6 ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. 11088 IN NS W20NS.mit.edu. mit.edu. 11088 IN NS STRAWB.mit.edu. ;; ADDITIONAL SECTION: STRAWB.mit.edu. 126738 IN A 18.71.0.151 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19901 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;eecs.mit.edu. IN A ;; ANSWER SECTION: eecs.mit.edu. 21600 IN A 18.62.1.6 ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. 11088 IN NS W20NS.mit.edu. mit.edu. 11088 IN NS STRAWB.mit.edu. ;; ADDITIONAL SECTION: STRAWB.mit.edu. 126738 IN A 18.71.0.151 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd Authority tells us the name servers responsible for ;; Got answer: the answer. Each RR gives the hostname of a different ;; ->>HEADER<<- opcode: name QUERY, server status: ( NS ) for NOERROR, names in mit.edu. id: 19901We should ;; flags: qr rd ra; QUERY: cache 1, each ANSWER: record for 1, 11,088 AUTHORITY: seconds. 3, ADDITIONAL: 3 ;; QUESTION SECTION: If the Answer had been empty, then the resolver s ;eecs.mit.edu. IN A next step would be to send the original query to one of these name servers. ;; ANSWER SECTION: eecs.mit.edu. 21600 IN A 18.62.1.6 ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. 11088 IN NS W20NS.mit.edu. mit.edu. 11088 IN NS STRAWB.mit.edu. ;; ADDITIONAL SECTION: STRAWB.mit.edu. 126738 IN A 18.71.0.151 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19901 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;eecs.mit.edu. Additional provides IN extra information A to save us from making separate lookups for it, or helps with bootstrapping. ;; ANSWER SECTION: eecs.mit.edu. Here, it tells 21600 us the IN IP addresses A for the 18.62.1.6 hostnames of the name servers. We add these to our cache. ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. 11088 IN NS W20NS.mit.edu. mit.edu. 11088 IN NS STRAWB.mit.edu. ;; ADDITIONAL SECTION: STRAWB.mit.edu. 126738 IN A 18.71.0.151 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

DNS Protocol Lightweight exchange of query and reply messages, both with same message format UDP Header IP Header 16 bits 16 bits SRC port DST port checksum length Primarily uses UDP for its transport protocol, which is what we ll assume Frequently, both clients and servers use port 53 UDP Payload Identification Flags # Questions # Answer RRs DNS Query or Reply # Authority RRs # Additional RRs Questions Answers Authority Additional information

DNS Protocol Lightweight exchange of query and reply messages, both with same message format UDP Header IP Header 16 bits 16 bits SRC=53 DST=53 checksum length Primarily uses UDP for its transport protocol, which is what we ll assume Frequently, both clients and servers use port 53 UDP Payload Identification Flags # Questions # Answer RRs DNS Query or Reply # Authority RRs # Additional RRs Questions Answers Authority Additional information

DNS Protocol, cont. Message header: Identification: 16 bit # for query, reply to query uses same # Along with repeating the Question and providing Answer(s), replies can include Authority (name server responsible for answer) and Additional (info client is likely to look up soon anyway) Each Resource Record has a Time To Live (in seconds) for caching (not shown) SRC=53 checksum Identification IP Header 16 bits 16 bits DST=53 length Flags # Questions # Answer RRs # Authority RRs # Additional RRs Questions Answers Authority Additional information

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19901 ;; flags: qr rd ra; QUERY: 1, What ANSWER: if the 1, mit.edu AUTHORITY: server 3, ADDITIONAL: 3 is untrustworthy? Could its operator steal, say, all of our web surfing to ;; QUESTION SECTION: ;eecs.mit.edu. IN A ;; ANSWER SECTION: berkeley.edu s main web eecs.mit.edu. 21600 IN A 18.62.1.6 server? ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. 11088 IN NS W20NS.mit.edu. mit.edu. 11088 IN NS STRAWB.mit.edu. ;; ADDITIONAL SECTION: STRAWB.mit.edu. 126738 IN A 18.71.0.151 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19901 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 Let s look at a flaw in the original DNS design (since fixed) ;; QUESTION SECTION: ;eecs.mit.edu. IN A ;; ANSWER SECTION: eecs.mit.edu. 21600 IN A 18.62.1.6 ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. 11088 IN NS W20NS.mit.edu. mit.edu. 11088 IN NS STRAWB.mit.edu. ;; ADDITIONAL SECTION: STRAWB.mit.edu. 126738 IN A 18.71.0.151 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19901 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;eecs.mit.edu. IN A What could happen if the mit.edu server returns the following to us instead? ;; ANSWER SECTION: eecs.mit.edu. 21600 IN A 18.62.1.6 ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. 11088 IN NS W20NS.mit.edu. mit.edu. 30 IN NS www.berkeley.edu. ;; ADDITIONAL SECTION: www.berkeley.edu. 30 IN A 18.6.6.6 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19901 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;eecs.mit.edu. IN A We d dutifully store in our cache a mapping of www.berkeley.edu to an IP address under MIT s control. (It could have been any IP address they wanted, not just one of theirs.) ;; ANSWER SECTION: eecs.mit.edu. 21600 IN A 18.62.1.6 ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. 11088 IN NS W20NS.mit.edu. mit.edu. 30 IN NS www.berkeley.edu. ;; ADDITIONAL SECTION: www.berkeley.edu. 30 IN A 18.6.6.6 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19901 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;eecs.mit.edu. IN A In this case they chose to make the ;; ANSWER SECTION: eecs.mit.edu. mapping disappear after 30 seconds. 21600 They could IN have made A it persist 18.62.1.6 for weeks, or disappear even quicker. ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. 11088 IN NS W20NS.mit.edu. mit.edu. 30 IN NS www.berkeley.edu. ;; ADDITIONAL SECTION: www.berkeley.edu. 30 IN A 18.6.6.6 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19901 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;eecs.mit.edu. IN A ;; ANSWER SECTION: eecs.mit.edu. 21600 IN A 18.62.1.6 How do we fix such cache poisoning? ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. 11088 IN NS W20NS.mit.edu. mit.edu. 30 IN NS www.berkeley.edu. ;; ADDITIONAL SECTION: www.berkeley.edu. 30 IN A 18.6.6.6 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

dig eecs.mit.edu A ; ; <<>> DiG 9.6.0-APPLE-P2 <<>> eecs.mit.edu a ;; global options: +cmd ;; Got answer: Don t accept Additional records unless ;; ->>HEADER<<- opcode: they re QUERY, for status: the domain NOERROR, we re id: looking 19901 up ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;eecs.mit.edu. IN A E.g., looking up eecs.mit.edu only accept additional records from *.mit.edu No extra risk in accepting these since server could return them to us directly in an Answer anyway. ;; ANSWER SECTION: eecs.mit.edu. 21600 IN A 18.62.1.6 ;; AUTHORITY SECTION: mit.edu. 11088 IN NS BITSY.mit.edu. mit.edu. = 11088 IN NS W20NS.mit.edu. mit.edu. 30 IN NS www.berkeley.edu. ;; ADDITIONAL SECTION: www.berkeley.edu. 30 IN A 18.6.6.6 BITSY.mit.edu. 166408 IN A 18.72.0.3 W20NS.mit.edu. 126738 IN A 18.70.0.160

Security risk #1: malicious DNS server Of course, if any of the DNS servers queried are malicious, they can lie to us and fool us about the answer to our DNS query and they used to be able to fool us about the answer to other queries, too, using cache poisoning. Now fixed (phew).

Security risk #2: on-path eavesdropper If attacker can eavesdrop on our traffic we re hosed. Why?

Security risk #2: on-path eavesdropper If attacker can eavesdrop on our traffic we re hosed. Why? They can see the query and the 16-bit transaction identifier, and race to send a spoofed response to our query.

Security risk #3: off-path attacker If attacker can t eavesdrop on our traffic, can he inject spoofed DNS responses? Answer: It used to be possible, via blind spoofing. We ve since deployed mitigations that makes this harder (but not totally impossible).

Blind spoofing 16 bits 16 bits SRC=53 DST=53 Say we look up mail.google.com; how can an off-path attacker feed us a bogus A answer before the legitimate server replies? How can such a remote attacker even know we are looking up mail.google.com? Suppose, e.g., we visit a web page under their control: checksum Identification length # Authority RRs # Additional RRs Questions Answers Authority Additional information...<img src="http://mail.google.com" >... Flags # Questions # Answer RRs

Blind spoofing 16 bits 16 bits SRC=53 DST=53 checksum Say we look up mail.google.com; how can an off-path attacker feed us a bogus A answer before the legitimate This server HTML replies? snippet causes our browser to try to fetch an image from How can mail.google.com. such an attacker To do that, our even know browser we first are looking has to look up up the IP Identification mail.google.com? address associated with that name. Suppose, e.g., we visit a web page under their control: length # Authority RRs # Additional RRs Questions Answers Authority Additional information...<img src="http://mail.google.com" >... Flags # Questions # Answer RRs

Blind spoofing Once they know we re looking it up, they just have to guess the Identification field and reply before legit server. How hard is that? Originally, identification field incremented by 1 for each request. How does attacker guess it? SRC=53 checksum Identification Fix? 16 bits 16 bits DST=53 length Flags # Questions # Answer RRs # Authority RRs # Additional RRs Questions Answers Authority Additional information <img src="http://badguy.com" > <img src="http://mail.google.com" > They observe ID k here So this will be k+1

DNS Blind Spoofing, cont. Once we randomize the Identification, attacker has a 1/65536 chance of guessing it correctly. Are we pretty much safe? Attacker can send lots of replies, not just one However: once reply from legit server arrives (with correct Identification), it s cached and no more opportunity to poison it. Victim is innoculated! 16 bits 16 bits SRC=53 checksum Identification DST=53 length Flags # Questions # Answer RRs # Authority RRs # Additional RRs Questions Answers Authority Additional information Unless attacker can send 1000s of replies before legit arrives, we re likely safe phew!?

Extra Material

Summary of DNS Security Issues DNS threats highlight: Attackers can attack opportunistically rather than eavesdropping o Cache poisoning only required victim to look up some name under attacker s control (has been fixed) Attackers can often manipulate victims into vulnerable activity o E.g., IMG SRC in web page to force DNS lookups Crucial for identifiers associated with communication to have sufficient entropy (= a lot of bits of unpredictability) Attacks only get better : threats that appears technically remote can become practical due to unforeseen cleverness

Common Security Assumptions (Note, these tend to be pessimistic but prudent) Attackers can interact with our systems without particular notice Probing (poking at systems) may go unnoticed even if highly repetitive, leading to crashes, and easy to detect It s easy for attackers to know general information about their targets OS types, software versions, usernames, server ports, IP addresses, usual patterns of activity, administrative procedures

Common Assumptions Attackers can obtain access to a copy of a given system to measure and/or determine how it works Attackers can make energetic use of automation They can often find clever ways to automate Attackers can pull off complicated coordination across a bunch of different elements/systems Attackers can bring large resources to bear if needed Computation, network capacity But they are not super-powerful (e.g., control entire ISPs)

Common Assumptions If it helps the attacker in some way, assume they can obtain privileges But if the privilege gives everything away (attack becomes trivial), then we care about unprivileged attacks The ability to robustly detect that an attack has occurred does not replace desirability of preventing Infrastructure machines/systems are well protected (hard to directly take over) So a vulnerability that requires infrastructure compromise is less worrisome than same vulnerability that doesn t

Common Assumptions Network routing is hard to alter other than with physical access near clients (e.g., coffeeshop ) Such access helps fool clients to send to wrong place Can enable Man-in-the-Middle (MITM) attacks We worry about attackers who are lucky Since often automation/repetition can help make luck Just because a system does not have apparent value, it may still be a target Attackers are undaunted by fear of getting caught