Using the Domain Name System for System Break-Ins
Total Page:16
File Type:pdf, Size:1020Kb
The following paper was originally published in the Proceedings of the Fifth USENIX UNIX Security Symposium Salt Lake City, Utah, June 1995. Using the Domain Name System for System Break-ins Steven M. Bellovin AT&T Bell Laboratories For more information about USENIX Association contact: 1. Phone: 510 528-8649 2. FAX: 510 548-5738 3. Email: [email protected] 4. WWW URL: http://www.usenix.org Using the Domain Name System for System Breakins Steven M Bellovin smbresearchattcom ATT Bel l Laboratories Abstract recommendations to software develop ers and system administrators Throughout this pap er we fo cus on the problem The DARPAInternet uses the Domain Name Sys as it applies to Berkeleys remote login and remote tem DNS a distributed database to map host shell services Wemention these sp ecically b ecause names to network addresses and viceversa Using they are ubiquitous and the source co de is read a vulnerability rst noticed byPV Mo ckap etris we ily available Almost certainlyany other network demonstrate how the DNS can b e abused to sub services that rely on host names for authentication vert system securityWe also show what to ols are would b e vulnerable This probably includes vari useful to the attacker Possible defenses against this ous implementations of remote or networked le sys attack including one implemented by Berkeley in re tems sp onse to our rep orts of this problem are discussed and the limitations on their applicability are demon strated The Domain Name System This paper was written in and was withheld from publication by the author The body of the paper The DNS is a distributed data base used to map is unchanged even to the extreme of giving the size host names to IP network layer addresses and of the Internet as hosts An epilogue has viceversa The name space is divided intoase been added that discusses why it was held back and ries of zones based on syntactic separators p erio ds whyitisnowbeing released in domain names One or more servers contain the hzone Secondary author authoritative data for eac itativeservers p erio dically p oll the primary servers Intro duction for their zones if the data has changed they initiate zone transfer op erations to refresh their databases In an earlier pap er Bel we discussed a number of Atany level a server may delegate the authority security problems with the TCPIP proto col suite for a sub domain to a dierentserver Thus if there Many of them turned on the abilityofanintruder to is a server for a toplevel domain comitmay itself sp o of the IP address of a trusted machine In real contain the information for companies smallcom ity though hosts extend trust to other hosts based and smallercom but delegate the resp onsibilityfor on their names not their addresses an attack er who monolithcom to one or more of that companys ma can sp o of a hosts name can ignore the more di chines In fact servers for a domain need not and cult problem of faking its IP address Some attacks often will not reside within that domain along just these lines were mentioned in the earlier In general hosts that use the DNS maintain lo pap er In resp onse to it PV Mo ckap etris disclosed cal caches of the resourcerecords returned All re to us a more devastating attack based on the Domain source records contain a TimetoLive eld set by Name System DNS Mo cb Mo ca Herein we the creator at the end of that p erio d the cached utilize his observationstoinvade selected machines record must b e discarded and an authoritative and demonstrate which other to ols aided the attack server queried anew Let us consider as an example the information for Section provides a brief overview of the DNS zone smallcomasshown in Figure The server Section provides the details of some actual attacks contains a numb er of resource records Perio ds at The names and IP addresses of the target hosts have b een changed to protect the inno cent Section dis There are many other DNS records than those describ ed cusses defenses and shows why most of them are here We are mentioning only those that provide information necessary to understand the subsequent discussions limited in their scop e We conclude byproviding ORIGIN smallcom smallcom IN SOA serversmallcom ghuwssmallcom Serial Refresh Retry Expire Minimum TimetoLive IN NS server IN NS servertinycom server IN A IN HINFO Smallic SmallIx boss IN A IN HINFO Smallic SmallIx ws IN A IN HINFO Smallic SmallIx ws IN A IN HINFO Smallic SmallIx Define a subdomain salessmallcom sales IN NS thinkersalessmallcom IN NS ws droidsalessmallcom IN A IN A Figure The zone smallcom the end of some names indicate that they are abso tween the dierentnetworks lute and not relativetothe ORIGIN eld An omit Four hosts are dened within the domain server ted name eld from a record indicates that the name boss ws and ws According to the HINFO record of the previous record should b e used And the ubiq all of the hosts app ear to b e Small Incs own com uitous IN eld indicates that the records b elong to puters and op erating system the Internet domain the DNS is capable of storing A DNS query may request a record of a particular information ab out many dierenttyp es of networks typ esayanA recordor it may ask for all records p ertaining to a given name A resp onse may con The SOA record denes the Start of Authority for tain just the answers desired a p ointer to the prop er the zone Primarily a glue record it contains two server if the information is not contained within this hine that is the elds of interest to us here the mac zone or an error indication if the record requested denitive source of the information in the zone and do es not exist the electronic mail address in a variant form of the p erson resp onsible Note incidentally that the SOA If appropriate an answer mayalsocontain Ad record also contains the minimum expiration time ditional Information Supp ose a query were sent for any resource records within the zone to the smallcom server asking for the address of crittersalessmallcom The reply would con The NS records dene the authoritativename tain not just the NS record for salessmallcom servers for the domain smallcom Similar NS but also the A record for that server records must b e in the server for the com domain so that inquiries may b e directed to the prop er place In addition the parent domain must contain A ad Inverse Mapping Domains dress records for all servers for its sub domains This is illustrated by the records for salessmallcoma The records describ ed ab ove suce for forward sub domain under separate administration queries where the client has a machine name and A host with more than one network interface will wishes to lo ok up the IP address However ordi normally havemultiple A records asso ciated with it nary DBMSstyle inverse queries to map addresses Such hosts are often but not always gateways b e into names do not work The reason why is a bit subtle Certainly one chine History demonstrates that b oth p ossibilities could ask any given server whichmachine corre are real sp onded to the address Unfortu The attackers goal is to nd hosts that trust other nately that server would b e unlikely to knowthe hosts using their names and to learn the names answer Nor without more information could the of some of those trusted partners While random client knowwhich server to query The DNS is a patterns of trust can and do exist a more fruit distributed database with b oundaries delimited by ful approachistolookfortwo common patterns host name syntax IP addresses contain no clues to hines each First in a cluster of timesharing mac this organization of the machines is likely to extend blanket trust to Instead inverse mappings are implemented bya the others Even if that do es not apply to the gen separate parallel tree keyed by IP address To eral user p opulation it probably do es apply to the systems programming and op erational stas Sec mimic the structure of IP addresses and hence the fashion in which they are assigned to administrators ond the attacker can lo ok for le servers and their the individual bytes of the address are reversed A workstations The le servers sometimes trust their standard sux is app ended to avoid name collisions clients serving as a source of extra CPU cycles Fur with forward mappings Thus the addresstoname thermore if the clients are dataless they will fre mapping for host wswhich has an IP address of quently trust an administrativemachine to p ermit would b e handled by a server for zone software maintenance inaddrarpa Its database with glue In the following examples we will assume that the records omitted lo oks like this target organization has the following machines Name IP Address Type ORIGIN inaddrarpa bullseyesoftyorg le server IN PTR serversmallcom ringersoftyorg workstation IN PTR bosssmallcom groundzerosoftyorg workstation IN PTR wssmallcom All are running some derivative of bsd or bsd IN PTR wssmall com suchas SunOS and all trust each other via Each record contains only a p ointer to the forward etchostsequiv les mapping record Generallytheinverse mapping tree The attacker whom we shall dub Cuckoo in honor will reside on the same machine as the corresp ond of Cli Stolls b o ok Sto is coming from machine ing forward mapping tree but this is not a require crackerrittsorg ment Hosts with more than one address will have The essence of the basic attack relies on the na PTR records in more than one inverse mapping tree ture of the addresstoname mapping As noted ab ove this mapping uses an indep endent DNS tree Assume