Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

CSC458 Naming and the DNS Network Security This Lecture


Published on

  • Be the first to comment

  • Be the first to like this

CSC458 Naming and the DNS Network Security This Lecture

  1. 1. CSC458 This Lecture Naming and the DNS • Naming Network Security Application • Focus Presentation – How do we name hosts etc.? Session Transport • Topics Network – Domain Name System (DNS) Data Link – Email/URLs Physical Names and Addresses Naming in Systems • Ubiquitous 51¢ – Files in filesystem, processes in OS, pages on the web, … name Stefan Saroiu • Decouple identifier for object/service from location 2040D South Building – Hostnames provide a level of indirection for IP addresses address UTM • Naming greatly impacts system capabilities and performance – Ethernet addresses are a flat 48 bits • Names are identifiers for objects/services (high level) • flat ! any address anywhere but large forwarding tables • Addresses are locators for objects/services (low level) – IP addresses are hierarchical 32/128 bits • Binding is the process of associating a name with an address • hierarchy ! smaller routing tables but constrained locations • Resolution is the process of looking up an address given a name • But, addresses are really lower-level names; many levels used
  2. 2. Internet Hostnames Original Hostname System • Hostnames are human-readable identifiers for end- • When the Internet was really young … systems based on an administrative hierarchy – is my desktop machine • Flat namespace – Simple (host, address) pairs • IP addresses are a fixed-length binary encoding for end- systems based on their position in the network • Centralized management – is cleo’s IP address – Updates via a single master file called HOSTS.TXT – Manually coordinated by the Network Information Center (NIC) • Original name resolution: HOSTS.TXT • Current name resolution: Domain Name System • Resolution process – Look up hostname in the HOSTS.TXT file • Future name resolution: ? Scaling Problems Domain Name System (DNS) • Coordination • Designed by Mockapetris and Dunlap in the mid 80s – Between all users to avoid conflicts • Namespace is hierarchical – Allows much better scaling of data structures • Inconsistencies – e.g., – Between update and distribution of new version • Namespace is distributed • Reliability – Decentralized administration and access – Single point of failure – e.g., * managed by CSC • Performance • Resolution is by query/response – Competition for centralized resources – With replicated servers for redundancy – With heavy use of caching for performance
  3. 3. DNS Hierarchy DNS Distribution • Data managed by zones that contain resource records – Zone is a complete description of a portion of the namespace – e.g., all hosts and addresses for machines in with pointers to edu com mil org … au subdomains like • One or more nameservers manage each zone mit – Zone transfers performed between nameservers for consistency • “dot” is the root of the hierarchy – Multiple nameservers provide redundancy • Top levels now controlled by ICANN ai lcs • Lower level control is delegated • Client resolvers query nameservers for specified records • Usage governed by conventions – Multiple messages may be exchanged per DNS lookup to navigate the • FQDN = Fully Qualified Domain Name name hierarchy (coming soon) DNS Lookups/Resolution Hierarchy of Nameservers Root • DNS queries/responses 2 name Root carried on UDP port 53 .ed u server name server e ton 33 inc 8.2 s .pr 6 .12 3 a.c .19 ad 28 cic ,1 .e du ton e nc 4 1 pri Client Local name Princeton name Princeton … Cisco server name server name server, server 8 5 cic ad cic a.c 19 ada s.p 2.1 .cs rin ce 2.6 .pr ton 9.6 inc 0 eto .ed 6 u CS … EE n.e name server name server du , CS name 7 server
  4. 4. Caching DNS Bootstrapping • Servers and clients cache results of DNS lookups • Need to know IP addresses of root servers before we can – Cache partial results too (e.g., server for make any queries – Greatly improves system performance; lookups the rare case • Addresses for 13 root servers ([a-m] • Cache using time-to-live (TTL) value from provider handled via initial configuration ( file) – higher TTL means less traffic, lower TTL means less stale info • Negative caching is used too! – errors can cause repeated queries for non-existent data Building on the DNS Future Evolution of the DNS • Other naming designs leverage the DNS • Design constrains us in two major ways that are increasingly less appropriate • Email: – e.g., is stefan in the domain • Static host to IP mapping – What about mobility (Mobile IP) and dynamic address assignment (DHCP) • Uniform Resource Locators (URLs) name for Web pages – e.g., • Location-insensitive queries – What if I don’t care what server a Web page comes from, as long – Use domain name to identify a Web server as it’s the right page? – Use “/” separated string to name path to page (like files) – e.g., a yahoo page might be replicated
  5. 5. Akamai Key Concepts • Use the DNS to effect selection of a nearby Web cache • The design of names, addresses and resolution has a significant impact on system capabilities 1 client Server 2 • Hierarchy, decentralization and caching allow the DNS 3 6 5 4 to scale Nearby DNS servers – These are general techniques! Cache for • Leverage separation of static/dynamic content • Beware DNS caching Last Time This Time • Naming • Network security Application Application • Focus Presentation • Focus Presentation – How do we name hosts etc.? Session – How do we secure distributed systems? Session Transport Transport • Topics Network • Topics Network – Domain Name System (DNS) Data Link – Privacy, integrity, authenticity Data Link Physical – Cryptography Physical – Practical security
  6. 6. What do we mean by “Security”? Approaches at 10,000 ft • Networks are fundamentally shared • Physical security – Need means to protect messages sent by legitimate participants – Tackle the problem of sharing directly from others with access to the network • “Security through obscurity” – Hope no-one will find out what you’re doing! • Privacy: messages can’t be eavesdropped • Throw math at the problem • Integrity: messages can’t be tampered with – Cryptography • Authenticity: messages were sent by the right party • Why is security difficult? • These are in addition to the need to protect networked – It’s a negative goal: can you be sure there are no flaws? systems from intrusions and compromise by attackers – Often assumptions turn out to be invalid, esp. randomness Basic Encryption for Privacy Secret Key Functions (DES, IDEA) Sender Receiver Plaintext Plaintext Plaintext (M) Plaintext (M) Encrypt with Decrypt with Encrypt Ciphertext (C) Decrypt secret key secret key E(M,KE) D(C, KD) Ciphertext • Cryptographer chooses functions E, D and keys KE, KD – Mathematical basis • Single key (symmetric) is shared between parties • Cryptanalyst try to “break” the system – Often chosen randomly, but must be communicated – Depends on what is known: E and D, M and C?
  7. 7. Basics of DES DES (cont.) Each Round: Initial permutation Block1 Block2 Block3 Block4 Li – 1 Ri – 1 Round 1 F Ki + + + + IV + Round 2 56-bit Li Ri DES DES DES DES key … DES uses a 64 bit key (56 + 8) Cipher1 Cipher2 Cipher3 Cipher4 Round 16 Message encrypted 64 bits at a time 16 rounds in the encryption • Repeat process for larger messages with “chaining” Final permutation Each round scrambles 64 bits Public Key Functions (RSA) Authentication Protocols Plaintext Plaintext • Three-way handshake for mutual authentication – Client and server share secrets, e.g., login password Encrypt with Decrypt with Client Server public key private key Clien tId, E ( x, C Ciphertext HK) ) , SHK K), E(y 1, SH Client authenticates E(x + server here E(y + 1, CH • Public and private key related mathematically K) Server authenticates – Public key can be published; private is a secret ) , SHK client here E(SK Session key exchanged
  8. 8. Authenticity and Integrity RSA Digital Signature • Sometimes we care about knowing messages authentic, Plaintext Plaintext but don’t care about privacy. • If only sender and receiver knew the keys we would be Encrypt with Decrypt with done … but that’s often not the case PRIVATE key PUBLIC key – A pair of keys for each pair of communicating parties? Ciphertext • In public key (RSA) systems the “encryption” key is potentially known by everyone – anyone could have sent us a confidential message by encrypting • Notice that we reversed the role of the keys (and the with our public key math just works out) so only one party can send the message but anyone can check it’s authenticity A Faster “RSA Signature” Message Digests (MD5, SHA) • Encryption can be expensive, e.g., RSA 1Kbps • Act as a cryptographic checksum or hash • To speed up, let’s sign just the checksum instead! – Typically small compared to message (MD5 128 bits) – Check that the encrypted bit is a signature of the checksum – “One-way”: infeasible to find two messages with same digest • Problem: Easy to alter data without altering checksum Message (padded) Initial digest • Answer: Cryptographically strong “checksums” called 512 bits 512 bits … 512 bits message digests where it’s computationally difficult to Transform choose data with a given checksum Transform – But they still run much more quickly than encryption … – MD5 (128 bits) is the most common example Transform Message digest
  9. 9. Cryptography in Protocols Practical issues • These techniques can be applied at different levels: • In practice, systems are not that secure – IP packets (IPSEC) – hackers can go after weakest link – Web transfers or other transports (SSL /TLS, Secure HTTP) • any system with bugs is vulnerable – Email (PGP) – vulnerability often not anticipated • usually not a brute force attack against encryption system – often can’t tell if system is compromised • hackers hide their tracks – can be hard to re-secure system after breakin • hackers can leave hard-to-detect backdoors Password dictionary attacks What do you trust? Why? • Moore’s law: brute force attacks get cheaper with time • Can you trust your login prompt? • UNIX passwords: – how do you know the person before you really logged out? – time to check all 5 letter passwords (lower case)? • Can you trust your web browser? • 26^5 =~ 10 million passwords • 1975: 1 day – what if somebody modified the installed version to capture your passwords and bank account numbers? • 1992: 10 seconds • 2002: 0.01 seconds – did you download the browser over the web? How do you know it wasn’t modified at the source, or in flight? – how about six letters, requiring upper, lower, number, and control character? – does your browser have vulnerabilities? How do you know the • 70^6 ~ 600 billion passwords web sites you’ve visited haven’t exploited them? • 1992: 6 days • Can you trust your email? • 2002: with 100 PC’s in parallel, <60 seconds (!!!) – how do you know the sender sent the mail, and that it wasn’t modified in flight?
  10. 10. The lure: an email message The mimicked website… The sinker…. How did this work? (1/3) • The email message itself is spam – sent to hundreds of millions of destination addresses – attacker only needs to harvest tiny fraction • Spam is typically transmitted through “relays” – compromised PCs forced to run relay software – makes it harder to trace and shut down attacker
  11. 11. How did this work? (2/3) How did this work? (3/3) • The link in the email message is really an image • The web page contains content that… – like the web, email can contain hyperlinked images – instructs IE not to show the real address bar • clicking on the image takes you to the linked web page • hides “…” from user – the image is: – displays images and text that spoofs an address bar containing a falsified URL – the link takes you to: – is some machine in China • most likely a compromised PC Internet worms • Worm performs the following steps: while(1) { pick random IP address; scan IP address for known remote vulnerability; if is vulnerable { exploit vulnerability and copy self to remote host; } } • Deadly, but can do much better – non-random scanning, multiple vulnerabilities, etc.
  12. 12. Why are worms bad? Famous examples • They cause damage to victims • Code Red v2 [2002] – worms can carry “payloads” – attacked Microsoft IIS web servers • e.g., install spyware – infected 500,000 victims within 10 hours • e.g., mount coordinated attack on a Web site – doubled in size every 37 minutes • They cause damage to the Internet • Sapphire [2003] – probing for victims and spreading causes Internet traffic – attacked Microsoft SQL server – a fast-spreading worm can overwhelm Internet links – infected 75,000 victims within 10 minutes – doubled in size every 8.5 seconds Worse case scenario Ping of Death • IP packets can be fragmented and reordered in flight • Hypothetical “hitlist” worm – probe for potential victims before releasing worm • Reassembly done at remote host – attack these susceptible victims first – can get fragments out of order, so host OS much allocate a buffer to hold fragments – avoids “random probe” that most worms perform • Malformed IP fragment is possible – offset + length > max packet size • In principle, would infect millions within seconds – Windows didn’t check this – could overflow buffer in Windows kernel • Was used for denial of service (crash Windows) – but could have been used for worm propagation
  13. 13. DNS cache poisoning Browser hacks • DNS queries/responses are unauthenticated • Netscape used to use time of day, process ID to seed – no encryption used random number generator • Many attacks possible as a result – random number used to pick conversation key • DNS cache poisoning: – easy to predict, and therefore break – attacker monitors network for a DNS query flowing by • Netscape used to be downloaded without encryption • e.g., for – four byte change to executable made it use attacker’s key – attacker spoofs a reply to “poison” the cache of whomever • Plenty of browser bugs asked the query – drive-by download: web server exploits bug to 0wn client • spoofed response points to server of attacker’s choosing – phishing attacks: attack web site looks like authoritative site – Imagine if UT’s DNS servers are poisoned… • often combined with homograph attack: – Social engineering Denial of Service in the News • Con person into giving out information • Phone secretary, say: – “Hi. I’m your company’s IT administrator. Your boss is currently traveling, and I can’t reach them. I need their password to verify their account hasn’t been broken into. This is really urgent.” • Somebody phones you, and says: Denial-of-service attack – “Hi. I’m with the Bank of America credit card fraud division. We’ve detected cripples Microsoft for second suspicious activity on your account, and we want to ensure you haven’t become a victim of identity theft. Before we start, I need to verify your identity. What is day By John Fontana your bank account number? SSN?” Network World Fusion, 01/25/01 • Often far more effective than technical attack Adding insult to injury, attackers launched – requires all people with access to sensitive information to be conscious of a denial-of-service attack against Microsoft security issues Thursday that crippled access to the company's Web sites for a second day.
  14. 14. What is Denial of Service? Complication: Spoofed Addresses • Attacker can deny service to legitimate users if they can overwhelm • Why reveal your real address? Instead, “spoof” it. the system providing the service – Can implicate others and appear to be many hosts – System is full of bugs … just send it packets that trigger them – System has limited bandwidth, CPU, memory, etc. … just sent it too many packets to handle • Solution? – Ingress filtering (ISPs check validity of source addresses) helps, • Big issue in practice and lack of effective solutions but has poor incentive patterns and is not a complete solution – Today, patch as found (CERT) or build implementation to tolerate DOS – Tomorrow, design protocols to withstand, possibly network support for shutting down attack? • Opportunity: “backscatter analysis” – host reponds to spoofed packet, sends response packet to • Two broad classes: essentially random IP – Nasty packets trigger implementation bugs, e.g., Ping of Death – if you have a large number of unused IPs, just listen and you’ll – Packet floods target bandwidth, CPU, memory, e.g., SYN flood hear the backscatter -- can measure DOS attacks! Complication: Reflectors & Amplifiers Distributed DOS (DDOS) • Some packets arriving “out of the blue” trigger a reply • Use automated tools to set up a network of zombies – Use this with spoofing to launder attack traffic (e.g., DNS) – Trin00, TFN, mstream, Stacheldraht, … – Use with broadcast addresses to amplify attack (e.g., Smurf)
  15. 15. Lessons • Encryption is powerful tool – strong mathematical properties – used to provide integrity, authenticity, privacy – must be used correctly • Many other security issues in practice – non-mathematical, “best practice” based – easy to get wrong • In the end, people are the weak link – social engineering