Information Security CS 526 Omar Chowdhury

Slides:



Advertisements
Similar presentations
Review iClickers. Ch 1: The Importance of DNS Security.
Advertisements

Sergei Komarov. DNS  Mechanism for IP hostname resolution  Globally distributed database  Hierarchical structure  Comprised of three components.
Domain Name System. DNS is a client/server protocol which provides Name to IP Address Resolution.
Computer Networks: Domain Name System. The domain name system (DNS) is an application-layer protocol for mapping domain names to IP addresses Vacation.
EEC-484/584 Computer Networks Lecture 6 Wenbing Zhao
CPSC 441: DNS1 Instructor: Anirban Mahanti Office: ICT Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes derived.
Foundations of Network and Computer Security J J ohn Black Lecture #35 Dec 9 th 2009 CSCI 6268/TLEN 5550, Fall 2009.
Presented by Neeta Jain CISC 856 TCP/IP and Upper Layer Protocols RFC 1034 & RFC 1035.
NET0183 Networks and Communications Lecture 25 DNS Domain Name System 8/25/20091 NET0183 Networks and Communications by Dr Andy Brooks.
CS 4396 Computer Networks Lab
1 Domain Name System (DNS). 2 DNS: Domain Name System Internet hosts: – IP address (32 bit) - used for addressing datagrams – “name”, e.g.,
CS426Fall 2010/Lecture 341 Computer Security CS 426 Lecture 34 DNS Security.
TELE 301 Lecture 11: DNS 1 Overview Last Lecture –Scheduled tasks and log management This Lecture –DNS Next Lecture –Address assignment (DHCP)
Chapter 16 – DNS. DNS Domain Name Service This service allows client machines to resolve computer names (domain names) to IP addresses DNS works at the.
Computer Networks: Domain Name System. The domain name system (DNS) is an application-layer protocol for mapping domain names to IP addresses Vacation.
CSUF Chapter 6 1. Computer Networks: Domain Name System 2.
IIT Indore © Neminath Hubballi
CS526Topic 19: DNS Security1 Information Security CS 526 Topic 19: DNS Security.
CS 471/571 Domain Name Server Slides from Kurose and Ross.
DNS: Domain Name System
1 DNS: Domain Name System People: many identifiers: m SSN, name, Passport # Internet hosts, routers: m IP address (32 bit) - used for addressing datagrams.
By Chris Racki. Outline  Introduction  How DNS works  A typical DNS lookup  Caching for later  Vulnerabilities of DNS  Anatomy of a cache poisoning.
October 15, 2002Serguei A. Mokhov, 1 Intro to DNS SOEN321 - Information Systems Security.
25.1 Chapter 25 Domain Name System Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
DNS Security Pacific IT Pros Nov. 5, Topics DoS Attacks on DNS Servers DoS Attacks by DNS Servers Poisoning DNS Records Monitoring DNS Traffic Leakage.
Netprog: DNS and name lookups1 Address Conversion Functions and The Domain Name System Refs: Chapter 9 RFC 1034 RFC 1035.
Packet Filtering & Firewalls. Stateless Packet Filtering Assume We can classify a “good” packet and/or a “bad packet” Each rule can examine that single.
Internet and Intranet Protocols and Applications Lecture 5 Application Protocols: DNS February 20, 2002 Joseph Conron Computer Science Department New York.
1 Kyung Hee University Chapter 18 Domain Name System.
Domain Name System Refs: Chapter 9 RFC 1034 RFC 1035.
CPSC 441: DNS 1. DNS: Domain Name System Internet hosts: m IP address (32 bit) - used for addressing datagrams m “name”, e.g., - used by.
EE 122: Lecture 20 (Domain Name Server - DNS) Ion Stoica Nov 15, 2001 (* based on the some on-line slides of J. Kurose & K. Rose and of Raj Jain)
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 19 Domain Name System (DNS)
DNS Cache Poisoning. History 1993 – DNS protocol allowed attacker to inject false data which was then cached 1997 – BIND 16-bit transaction ids not randomized,
DNS Security Extension 1. Implication of Kaminsky Attack Dramatically reduces the complexity and increases the effectiveness of DNS cache poisoning –No.
DNS Cache Poisoning – The Next Generation by Joe Stewart, GCIH Presented by Stephen Karg CS510, Advanced Security Portland State University Oct. 24, 2005.
DNS Security 1. Fundamental Problems of Network Security Internet was designed without security in mind –Initial design focused more on how to make it.
Web Server Administration Chapter 4 Name Resolution.
1. Internet hosts:  IP address (32 bit) - used for addressing datagrams  “name”, e.g., ww.yahoo.com - used by humans DNS: provides translation between.
COMP2322 Lab 3 DNS Steven Lee Feb. 19, Content Understand the Domain Name System (DNS). Analyze the DNS protocol with Wireshark. 2.
COMP 431 Internet Services & Protocols
Grades update. Homework #1 Count35 Minimum Value47.00 Maximum Value Average
Short Intro to DNS (part of Tirgul 9) Nir Gazit. What is DNS? DNS = Domain Name System. For translation of host names to IPs. A Distributed Database System.
MAN-IN-THE-MIDDLE ATTACK STEGANOGRAPHY Lab# MAC Addresses and ARP  32-bit IP address:  network-layer address  used to get datagram to destination.
Security Issues with Domain Name Systems
Domain Name System (DNS)
Networking Applications
Attacking DNS Slides adapted from Olaf Kolkman, RIPE Lecture 18
Introduction to Networks
DNS Security Advanced Network Security Peter Reiher August, 2014
DNS Security.
Chapter 9: Domain Name Servers
Module 5: Resolving Host Names by Using Domain Name System (DNS)
DNS Security Issues SeongHo Cho DPNM Lab., POSTECH
IMPLEMENTING NAME RESOLUTION USING DNS
DNS.
DNS Session 5 Additional Topics
CIT 480: Securing Computer Systems
DNS Cache Poisoning Attack
DNS security.
Chapter 19 Domain Name System (DNS)
Domain Name System (DNS)
NET 536 Network Security Lecture 8: DNS Security
NET 536 Network Security Lecture 6: DNS Security
DNS: Domain Name System
Domain Name System Refs: Chapter 9 RFC 1034 RFC 1035.
The Application Layer: Sockets, DNS
COMPUTER NETWORKS PRESENTATION
An Engineering Approach to Computer Networking
DNS Security The Domain Name Service (DNS) translates human-readable names to IP addresses E.g., thesiger.cs.ucla.edu translates to DNS.
Presentation transcript:

Information Security CS 526 Omar Chowdhury DNS Security Information Security CS 526 Omar Chowdhury 9/18/2018 Topic: RBAC

Reading for This Lecture Optional: First attack by Schuba and Spafford - http://www.openbsd.org/advisories/sni_12_resolverid.txt An Illustrated Guide to the Kaminsky DNS Vulnerability Dan Kaminsky's Black Hat presentation (PowerPoint) 9/18/2018 Topic: RBAC

Purpose of Naming Addresses are used to locate objects Names are easier to remember than numbers You would like to get to the address or other objects using a name DNS provides a mapping from names to resources of several types 9/18/2018 Topic: RBAC

Domain Name System (DNS) Forward DNS Resolution Given a domain name lookup the associated IP address Example: cs.purdue.edu ⇒ 128.10.19.20 Reverse DNS lookup Given an IP address lookup the domain name associated with the IP address Usage: Network troubleshooting, anti-spam techniques 9/18/2018 Topic: RBAC

DNS—Distributed Database DNS records are kept in a distributed fashion Highly dynamic Decentralized authority 9/18/2018 Topic: RBAC

DNS–Hierarchical Namespace Top-level domains (TLD) 9/18/2018 Topic: RBAC

Root DNS Servers 9/18/2018 Topic: RBAC

Domain Name Servers Top-level domain (TLD) servers Responsible for com, org, net, edu, etc. All top-level country domains, e.g. uk, fr, ca, jp, in. Network Solutions, LLC  controls com servers Authoritative DNS servers Organization’s DNS servers, providing authoritative hostname to IP mappings for organization’s servers. Can be maintained by organization or service provider Local DNS servers Not strictly part of the domain hierarchy Each ISP (university, hospital, company) has one cs.purdue.edu’s authoritative DNS servers are: pendragon.cs.purdue.edu. ns.purdue.edu. harbor.ecn.purdue.edu. ns2.purdue.edu. 9/18/2018 Topic: RBAC

DNS Resolving When a host makes a DNS query, it is forwarded to a local upstream resolver The local upstream resolver acts as a proxy and forwards query into the domain name hierarchy Two resolution schemes: Iterative Recursive 9/18/2018 Topic: RBAC

Iterative and Recursive Resolution 9/18/2018 Topic: RBAC

DNS Result Caching DNS responses are cached Enables responding to the same query fast Negative results are cached too Saves time for nonexistent sites, e.g., mistyping Cached data has expiration Each DNS record (also known as, resource record or just RR) has an associated field called Time-To- Live (in short, TTL) 9/18/2018 Topic: RBAC

DNS Name Resolution 9/18/2018 Topic: RBAC

DNS Packet in the Wire 1-bit, 0-Query, 1-Ans 0-query 16-bit ID (TXID) 1 for Authoritative Answer, 0-otherwise Response code from server 1 for truncated answer 1 for recursion available 1 for recursion desired 9/18/2018 Topic: RBAC

Selective DNS Record Types A record Domain name to IP mapping NS record Information about (authoritative) DNS server MX record Mail exchange record SOA record Key information about the zone (e.g., contact address of the admin) CNAME record Canonical or alias of a domain TXT record Textual description of the domain 9/18/2018 Topic: RBAC

DNS Packet Payload Question Section Answer Section Authority Section Contains the question asked Answer Section Contains the records that answer the question Authority Section Contains the records that point to domain authority Additional Section Glue records IP address of the domain authorities Break circular dependency 9/18/2018 Topic: RBAC

DNS Name Resolution www.unixwiz.net www.unixwiz.net www.unixwiz.net A.ROOT-SERVERS.NET. IN A 198.41.0.4 B.ROOT-SERVERS.NET. IN A 192.228.79.201 C.ROOT-SERVERS.NET. IN A 192.33.4.12 ... M.ROOT-SERVERS.NET. IN A 202.12.27.33 /* Authority section */ NET. IN NS A.GTLD-SERVERS.NET. IN NS B.GTLD-SERVERS.NET. IN NS C.GTLD-SERVERS.NET. ... IN NS M.GTLD-SERVERS.NET. /* Additional section - "glue" records */ A.GTLD-SERVERS.net. IN A 192.5.6.30 B.GTLD-SERVERS.net. IN A 192.33.14.30 C.GTLD-SERVERS.net. IN A 192.26.92.30 M.GTLD-SERVERS.net. IN A 192.55.83.30 www.unixwiz.net www.unixwiz.net /* Authority section */ unixwiz.net. IN NS cs.unixwiz.net. IN NS linux.unixwiz.net. /* Additional section - "glue" records */ cs.unixwiz.net. IN A 8.7.25.94 linux.unixwiz.net. IN A 64.170.162.98 9/18/2018 Topic: RBAC

Inherent DNS Vulnerabilities Users typically trust the host-address mapping provided by the DNS What can go wrong with bad DNS information? DNS resolvers trust responses received after sending out queries How can one exploit this? Root of all evil: No authentication for DNS responses 9/18/2018 Topic: RBAC

User side attack—Pharming Exploit DNS poisoning attack Change IP addresses to redirect URLs to bad sites Potentially more dangerous than phishing attacks DNS poisoning attacks are not uncommon: January 2005, the domain name for a large New York ISP, Panix, was hijacked to a site in Australia November 2004, Google and Amazon users were sent to Med Network Inc., an online pharmacy 9/18/2018 Topic: RBAC

DNS Cache Poisoning Attacker wants his IP address returned for a DNS query When the resolver asks ns1.google.com for www.google.com, the attacker could reply first, with his own IP What is supposed to prevent this? Transaction or Query ID 16-bit random number The real server knows the number, because it was contained in the query The attacker has to guess 9/18/2018 Topic: RBAC

DNS Cache Poisoning (contd.) Responding before the real DNS server An attacker can guess when a DNS cache entry times out and a query has been sent, and provide a fake response. The fake response will be accepted only when its 16-bit transaction ID matches the query CERT reported in 1997 that BIND uses sequential transaction ID and is easily predicted fixed by using random transaction IDs 9/18/2018 Topic: RBAC

DNS Cache Poisoning: Racing to Respond First 9/18/2018 Topic: RBAC

DNS Cache Poisoning Attack 1 Schuba and Spafford in 1993 Intuition: Predictable Query ID (QID) First, guess QID: Ask (dns.target.com) for www.evil.org Request is sent to dns.evil.org (get QID) Attacker controls dns.evil.org Second, attack: Ask (dns.target.com) for www.yahoo.com Gives responses from dns.yahoo.com to the attackers chosen IP 9/18/2018 Topic: RBAC

Defense: the Bailiwicks Rules The bailiwick system prevents foo.com from declaring anything about com, or some other new TLD, or www.google.com Using the bailiwicks rules The root servers can return any record The com servers can return any record for com The google.com servers can return any record for google.com 9/18/2018 Topic: RBAC

DNS Cache Poisoning Attack 2 Birthday Attack – Vagner Sacramento 2002 Have many clients send the same DNS request to the resolver Each such request generated a DNS query Send hundreds of reply with random TXID at the same time Due to birthday paradox, the success probability can be close to 1: With a few hundred client queries and several hundred fake responses Defense– Rate limiting For all the client queries asking for the same domain name, only send out one DNS query 9/18/2018 Topic: RBAC

DNS Cache Poisoning – so far Early versions of DNS servers deterministically incremented the ID field Vulnerabilities were discovered in the random ID generation Weak random number generator The attacker is able to predict the ID if knowing several IDs in previous transactions Birthday attack 16- bit (only 65,536 options). Force the resolver to send many identical queries, with different IDs, at the same time Increase the probability of making a correct guess 9/18/2018 Topic: RBAC

DNS Cache Poisoning Attack 3 Dan Kaminsky 2008 Kaminsky Attack Big security news in summer of 2008 DNS servers were quickly patched to defend against this attack Sophisticated attack In prior attacks, when the attacker loses the race, the record is cached with a TTL Before TTL expires, new instance of the attack cannot be carried out Poisoning address for google.com in a DNS server is not easy 9/18/2018 Topic: RBAC

Features of Kaminsky Attack The attacker does not need to wait to launch an attack The bad guy asks the resolver to look up www.google.com If the bad guy lost the race, the other race for www.google.com will be suppressed by the TTL If the bad guy asks the resolver to look up 1.google.com, 2.google.com, 3.google.com, and so on Each new query starts a new race Eventually, the bad guy will win he is able to spoof 183.google.com So what? No one wants to visit 183.google.com 9/18/2018 Topic: RBAC

Kaminsky-style Poisoning A bad guy who wins the race for “183.google.com” can end up stealing “www.google.com” as well Original malicious response: google.com NS www.google.com www.google.com A 6.6.6.6 Killer response: google.com NS ns1.google.com ns1.google.com A 12.34.56.78 [GLUE RECORD] 9/18/2018 Topic: RBAC

Kaminsky-style Poisoning Why does it succeed? The attacker can start a new instance of attack anytime without waiting for the cache entry to expire No wait penalty for racing failure The attack is only bandwidth limited 9/18/2018 Topic: RBAC

Defenses based on increasing the entropy 9/18/2018 Topic: RBAC

Defense – 1 (Source Port Randomization) Use a random source port for each out-going DNS query Entropy: 16-bit (from TXID) + 11-bit (from source port) = 27-bit entropy To win, the attacker has a much bigger space of possible IDs to forge a valid response Limitation: When the resolver is behind a NAT device, the additional entropy provided by source port randomization is low (e.g., 2 bits) 9/18/2018 Topic: RBAC

Defense – 2 (0x20 Randomization) Domain names are case-insensitive www.google.com and WWW.GOOGLE.COM resolves to the same IP address Randomly change some of the characters in the domain name to upper case letters The expectation is that the resolver responding will copy the domain name in the response from the query Limitations: Attacker can query: www.123.com Some of the resolvers always return domain name in all lower- case Some of the resolvers use a case-sensitive matching 70% resolvers support 0x20 randomization 9/18/2018 Topic: RBAC

Defense – 3 (WSEC DNS) While querying root or TLD DNS servers, preprend random prefix Ddsj030gojfd.www.google.com and www.google.com returns the same RRs (not IP) Limitations: Domain names can be maximum 255-byte length Attackers can query 255-byte domains This is applicable to referrals not A queries Some resolvers exclude long domain names as they are uncommon 9/18/2018 Topic: RBAC

Defense – 4 (Randomize destination IP address) Multiple IP addresses for a DNS server Choose one randomly from that list to query Limitations: The set of IP addresses are small They are many time predictable Attack it to make it more predictable ns.purdue.edu. 86400 IN A 128.210.11.5 ns2.purdue.edu. 86400 IN A 128.210.11.57 harbor.ecn.purdue.edu. 86400 IN A 128.46.154.76 pendragon.cs.purdue.edu. 86400 IN A 128.10.2.5 9/18/2018 Topic: RBAC

Defense—5 (Randomizing Source IP) This is called the NAT-antidote This is applicable when the resolver is behind a NAT When NAT receives a query from the resolver, it randomly changes the source IP address to a random IP in that network Limitations: Extra entropy depends on the network size 9/18/2018 Topic: RBAC

Adaptive & Long- term Defenses 9/18/2018 Topic: RBAC

Can happen in benign cases as DNS runs on top of UDP Attack Detection Received a response for a query and the TXID of the response does not match with the query’s TXID Can happen in benign cases as DNS runs on top of UDP 9/18/2018 Topic: RBAC

Defense—6 (Sandwich Antidote) Detect attack and apply sandwich antidote For querying www.google.com Query 1: dfjfdkjfhksdf.google.com Query 2: www.google.com [REAL QUERY] Query 3: jkjkjoiojohh.google.com Observe whether the response arrive in-order Limitation: Our experiment suggest that 50% of the queries arrive in order 9/18/2018 Topic: RBAC

Defense—7 (DNSSEC) Proposed as a long-term solution Uses digitally signed responses Prevents cache poisoning attacks Limitations: Adoption is very slow– 1% of all the .com and .net domains are secured by DNSSEC Opens door for DoS attack due to large response size 9/18/2018 Topic: RBAC

Defense – 8 (Use TCP) Run DNS protocol on top of TCP instead of UDP Limitations: High latency (almost 2X) Resolver throughput rate (1/10th) Not all resolvers support TCP In our experiment with Alexa’s top 15K domains, 10% of their authoritative nameservers do not support TCP – includes Facebook 9/18/2018 Topic: RBAC

Defense – 9 (Adaptively use TCP) Run DNS protocol on top of TCP instead of UDP only when detected attack Nominum implemented it in their product Vantio CacheServe Limitations: Attack detection is not fine-grained – benign cases will be considered as attack Same as before Susceptible to the new attack we have proposed 9/18/2018 Topic: RBAC

Acknowledgement Some of the slide materials are inspired by materials from Ninghui Li and http://unixwiz.net/. 9/18/2018 Topic: RBAC