DNS緩存投毒攻擊原理與防御策略
N ETWORK & INFORMATION SECURITY網(wǎng)絡與信息安全DNS緩存投毒攻擊原理與防御策略靳沖1,2,郝志宇1,吳志剛112中國科學院計算技術研究所,北京100190中國科學院研
N ETWORK & INFORMATION SECURITY
網(wǎng)絡與信息安全
DNS緩存投毒攻擊原理與防御策略
靳沖1,2,郝志宇1,吳志剛1
1
2中國科學院計算技術研究所,北京100190中國科學院研究生院,北京100190
摘 要:DNS是Internet最重要的基礎設施之一,若遭受攻擊將影響Internet的正常運轉,因而其安全性備受關注。本文分析了傳統(tǒng)以及新型(Kaminsky)DNS緩存投毒(Cache Poisoning)攻擊的原理,給出攻擊實例,詳細描述了攻擊流程,驗證了DNS緩存投毒攻擊潛在的危害性,并提出若干防御策略。
關鍵詞:DNS;緩存投毒;Kaminsky攻擊
Principles and Defense Strategies of DNS Cache Poisoning
Jin Chong1, 2, Hao Zhiyu1, Wu Zhigang1
1
2Institute of Computing Technology of Chinese Academy of Sciences, Beijing 100190Graduate University of Chinese Academy of Sciences, Beijing 100190
Abstract : DNS is one of the most important basic infrastructures of the Internet, attacks on which will prevent the Internet from working properly. Therefore, its security is receiving great concern. This
paper analyzes the principles of both traditional and novel (Kaminsky) DNS Cache Poisoning, presents attack samples and describes the whole attack process in detail. After verifying the potential harm of DNS Cache Poisoning, the paper gives out several defense strategies.
Key Words: DNS; cache poisoning; Kaminsky attack
I.概述
DNS(Domain Name System)是一個多層次的
分布式數(shù)據(jù)庫系統(tǒng),其基本功能是完成域名解析,
即提供域名和IP 地址之間的映射關系,為互聯(lián)網(wǎng)
(Internet)用戶提供便利。DNS 是Internet 的基礎,
也是目前互聯(lián)網(wǎng)上最成功的應用之一,其安全性備受關注。DNS緩存投毒(DNS Cache Poisoning)是DNS 攻擊中危害較大的一種,也是當前DNS 攻擊領域的研究熱點。它通過使用虛假IP 地址信息替換名字服務器緩存中主機記錄的真實IP 地址信息來制造破壞[6,7]。本文介紹了傳統(tǒng)DNS 緩存投毒攻擊以及新型的Kaminsky 攻擊的基本原理,并提出了可行的防御策略。
2009.11 17
,China Communications
II.傳統(tǒng)DNS緩存投毒攻擊
一臺DNS 服務器只記錄本地資源的所有授權主機,若想查詢非本地的主機信息,則要向信息持有者(權威DNS 服務器)發(fā)送查詢請求。為了避免每次查詢都發(fā)送請求,DNS服務器會把權威DNS 服務器返回的查詢結果保存在緩存中,并保持一定時間,這就構成了DNS 緩存(DNS Cache)。DNS緩存投毒攻擊就是通過污染DNS Cache,用虛假的IP 地址信息替換Cache 中主機記錄的真實IP 地址信息來制造破壞。
2.1 DNS解析過程
在分析DNS 緩存投毒攻擊原理之前,先闡述一下DNS 解析過程。假設要查詢的域名為,并假設客戶端和首選的緩存名字服務器(即緩存DNS 服務器)滿足以下條件:
(1)首選緩存名字服務器和客戶端首次啟動,沒有本地緩存信息。
(2)首選緩存名字服務器不是目標域名的權威名字服務器。
查詢過程如圖1所示,步驟如下:
(1)客戶端向首選緩存名字服務器發(fā)起遞歸查詢的請求。
(2)首選緩存名字服務器檢查本地資源記錄, 若存在則作授權回答;若不存在,則檢查本地緩存,
如存在則直接給客戶端返回結果。若本地資源記錄
和緩存中都不存在,則向根名字服務器發(fā)起迭代查詢。根據(jù)假設條件,本例查詢中將向根名字服務器繼續(xù)查詢。
(3)根名字服務器返回cn 域的權威名字服務器(即頂級域名服務器)的地址,首選緩存名字服務器繼續(xù)向頂級域名服務器發(fā)起迭代查詢。
(4)頂級域名服務器返回ac.cn 域的權威名字
服務器地址,首選緩存名字服務器繼續(xù)向該地址請求迭代查詢。如此繼續(xù),直到得到的授權回答,保存在本地緩存中,并返回給客戶端,完成此次查詢。
2.2 DNS報文格式
DNS 定義了用于查詢和應答的報文格式,通常采用UDP 協(xié)議傳輸查詢請求和應答數(shù)據(jù)包。表1 (a)顯示了DNS 查詢報文格式,表1 (b)顯示了DNS 應答報文格式。
表1(a) DNS查詢報文標識問題數(shù)
查詢問題
標志
資源記錄數(shù)附加資源記錄數(shù)
授權資源記錄數(shù)
表1(b) DNS應答報文標識 問題數(shù) 授權資源記錄數(shù)
查詢問題
標志 資源記錄數(shù)附加資源記錄數(shù)
回答資源記錄(可變)授權資源記錄(可變)附加資源記錄(可變)

2.3 傳統(tǒng)DNS緩存投毒攻擊原理
目前DNS 采用UDP 協(xié)議傳輸查詢和應答數(shù)據(jù)包,采用簡單信任機制,對首先收到的應答數(shù)據(jù)包僅進行原查詢包發(fā)送IP 地址、端口和隨機查詢ID 的確認,而不會對數(shù)據(jù)包的合法性做任何分析,若匹配,則接受其作為正確應答數(shù)據(jù)包,繼續(xù)DNS 解析過程,并丟棄后續(xù)到達的所有應答數(shù)據(jù)包。這就使得攻擊者可以仿冒權威名字服務器向緩存DNS 服務器發(fā)送偽造應答包,力爭搶先完成應答以污染DNS 緩存。若攻擊者發(fā)送的偽造應答包在權威名字服務器發(fā)送的正確應答包之前到達緩存DNS 服務器,并與原查詢包IP 地址、端口和隨機查詢ID 相匹配,就能夠成功污染DNS 緩存。圖2顯示了傳統(tǒng)DNS 緩存投毒攻擊的過程。
攻擊者偽造的應答數(shù)據(jù)包(紅色所示)若能先于正確應答數(shù)據(jù)包(黑色所示)到達緩存DNS 服務器,并與原查詢包發(fā)送IP 地址、端口和隨機查詢ID 相匹
18 2009.11
,N ETWORK & INFORMATION SECURITY
網(wǎng)絡與信息安全



配,則將成功污染緩存DNS 服務器的Cache[10],使
得在該Cache 有效期內,所有使用該緩存DNS 服務器的用戶對域名。
2.4 傳統(tǒng)DNS緩存投毒攻擊的缺陷
圖3顯示的是傳統(tǒng)DNS 緩存投毒攻擊成功的時間序列示意圖[1]。
其中,Active Attack階段表示:緩存DNS 服務器的Cache 中沒有要查詢域名主機的記錄,因而向外發(fā)送查詢數(shù)據(jù)包,從向該域名主機的權威名字服務器發(fā)送查詢請求開始到收到應答數(shù)據(jù)包的時間(即如圖1中過程(4))。若緩存DNS 服務器的Cache 中存在要查詢域名主機的記錄,則緩存DNS 服務器將直接由Cache 中讀取相應信息,TTL則表示DNS Cache 中對已有記錄信息的保持時間。
(1)如果DNS Cache 中沒有攻擊目標域名的記錄,則由傳統(tǒng)DNS 緩存投毒攻擊原理可知,攻擊者在Active Attack階段內發(fā)動攻擊,且偽造的應答數(shù)據(jù)包在Active Attack階段內到達緩存DNS 服務器,才有可能污染Cache,使得攻擊成功。
(2)如果DNS Cache 中存在攻擊目標域名的記錄,即處于TTL 時間段內,這時緩存DNS 服務器將直接從Cache 中讀取信息,而不再進行向根名字服務器等的迭代查詢,攻擊者將不可能成功;這種情況下,攻擊者要等該記錄在Cache 中失效,即TTL 時間后,重新處于(1)中所述情況時,再發(fā)動攻擊,才有可能成功。
當對同一域名持續(xù)攻擊時,假設攻擊開始前緩存DNS 服務器的Cache 中沒有該域名記錄,若在一個Active Attack階段中攻擊不成功,再組織有效攻
擊則需要有TTL 的時間間隔。但是,Active Attack
階段時間一般較短,而當前大多數(shù)緩存DNS 服務器的Cache TTL 設置的時間又較長,這就導致一定時間內可利用的攻擊時間很少,大大降低了攻擊成功的概率。這也就是傳統(tǒng)DNS 緩存投毒攻擊最早在1990年即已出現(xiàn),并且一旦攻擊成功,危害極為嚴重,卻一直沒有引起廣泛關注的原因。然而,新型的Kaminsky 攻擊克服了這一缺陷,大大提高了攻擊成功率,因此一經(jīng)公布就受到廣泛重視。III.KAMINSKY緩存投毒攻擊
2008年夏天,Dan Kaminsky 發(fā)現(xiàn)了一種新型DNS 緩存投毒攻擊,引起了網(wǎng)絡安全界的廣泛關注。該攻擊方法克服了傳統(tǒng)DNS 緩存投毒攻擊存在的攻擊所需時間長、成功率很低的缺陷。
3.1 Kaminsky攻擊原理
傳統(tǒng)的DNS 緩存投毒攻擊,污染的目標是應答數(shù)據(jù)包中帶有查詢結果IP 地址的回答資源記錄部分(參見表1 (b)),而Kaminsky 攻擊上升了一個層次,污染的目標是應答數(shù)據(jù)包中Authority Records部分(授權資源記錄,參見表1 (b))。圖4顯示了Kaminsky 攻擊流程。
(1)攻擊者向被攻擊的目標服務器發(fā)送一個DNS 查詢請求,該查詢請求中的域名主機使用隨機序列和目標域名的組合,如圖4中的www276930. ict.ac.cn,其中ict.ac.cn 為目標域名,276930是隨機生成的序列。顯然,這個查詢的域名主機是不存在的,正常返回的應答數(shù)據(jù)包中回答資源記錄部分應為NXDOMAIN(表示該域名主機不存在)。
(2)被攻擊目標服務器會按2.1節(jié)中所述DNS
2009.11
19
,China Communications
解析過程進行查詢,此時攻擊者偽造應答數(shù)據(jù)包(紅色所示)并發(fā)送給目標服務器,若該數(shù)據(jù)包能在正確應答包(黑色所示) 之前到達目標服務器,并能成功匹配原查詢包發(fā)送IP 地址、端口和隨機查詢ID,則攻擊成功。
(3)在攻擊者偽造的應答數(shù)據(jù)包中,回答資源記錄部分與正確應答包一樣(NXDOMAIN,表示該域名主機不存在),但是授權資源記錄部分是ns1. ict.ac.cn 的偽造IP 地址1.1.1.1,一旦攻擊成功,該資源記錄信息將被寫入目標服務器的Cache 中。在Cache 保持時間內,對名字服務器ns1.ict.ac.cn 管轄的所有域名的查詢都將被發(fā)送到攻擊者自己控制的IP(1.1.1.1)中。
3.2 Kaminsky攻擊的優(yōu)勢
(1)如2.4節(jié)所述,傳統(tǒng)DNS 緩存投毒攻擊中,存在攻擊所需時間長、成功率低的問題,而Kaminsky 攻擊克服了這一缺陷。Kaminsky攻擊中,對同一域名進行持續(xù)攻擊,每次查詢都會在目標域名上添加隨機序列,這使得在目標DNS Cache 中一般不存在各個構造域名主機的記錄,因此若攻擊不成功,則可以更換隨機序列連續(xù)不斷地進行攻擊,不存在有效攻擊時間的問題,也不存在攻擊時間間隔,這將極大地節(jié)省攻擊所需時間,有效提高攻擊成功率。
(2)傳統(tǒng)DNS 緩存投毒攻擊成功后,只是污染了目標DNS Cache 中的一條主機記錄,之后對這一個域名主機的查詢將被發(fā)送到攻擊者控制的IP地址。而Kaminsky 攻擊成功后,污染的是目標DNS Cache 中一個域名主機的權威名字服務器的記錄,之后對該名字服務器管轄的所有域名主機的查詢都將被發(fā)送到攻擊者控制的IP 地址中,破壞力度遠高于傳統(tǒng)
DNS 緩存攻擊。
3.3 緩存投毒攻擊所需信息3.3.1所需信息
一個偽造的DNS 應答數(shù)據(jù)包需要的信息包括TCP/IP層和DNS 協(xié)議層兩方面。
TCP/IP層包括srcip(權威名字服務器的IP 地址)、dstip(被攻擊的緩存DNS 服務器IP 地址)、sport(權威名字服務器使用的端口,通常為53)、dport(被攻擊的緩存DNS 服務器發(fā)送請求報文時使用的端口)。
DNS 協(xié)議層包括查詢域名、TXID(查詢隨機ID,16bit)。
3.3.2 獲取方式
srcip 通過查詢要攻擊域名的NS 即可獲得,可以用dig、nslookup 等命令查詢得到。sport通常為53。在公網(wǎng)上搜索可以得到要攻擊DNS 服務器的IP 地址信息,從而獲得dstip。緩存投毒攻擊為攻擊者主動發(fā)送查詢數(shù)據(jù)包,因此查詢域名為攻擊者自己構造,相當于已知,例如在3.1節(jié)中,查詢域名為276930.ict.ac.cn。
最難獲得的是dport 和TXID 字段。dport和TXID 都是16bit 字段,兩者都有216(65536)種可能值。對于TXID,只能進行猜測,在被攻擊的緩存DNS 服務器收到正確應答包之前,越多的偽造應答包到達,命中率越高。對于dport 可以有如下幾種獲取方法:
(1)猜測。若TXID 和dport 均采用猜測法,那么每個偽造應答包命中的概率僅為1/ (65536x65536),攻擊成功難度較大。
(2)有些DNS 服務器軟件,如Bind 的一些版本,

在每次進程啟動到停止之間,其發(fā)送查詢數(shù)據(jù)包的

圖5 查詢配置域名
20 2009.11
,N ETWORK & INFORMATION SECURITY
網(wǎng)絡與信息安全
圖6 獲取唯一源端口
源端口都是唯一的[3, 4]。對于上述DNS 服務器,可以通過其他手段獲得其源端口,即偽造應答包的dport。例如,通過porttest.dns-oarc.net就可得知哪些DNS 服務器存在源端口唯一的漏洞;若再掌握一臺權威名字服務器,通過捕包即可獲得存在漏洞的DNS 服務器的源端口號。具體方法如下:
在一臺可控DNS 服務器上申請域名,例如:dnstest.com.cn,并為其配置一個權威名字服務器,例如:ns1.dnstest.com.cn。用dig 命令發(fā)送查詢域名dnstest.com.cn 的數(shù)據(jù)包,如圖5所示,其中10.0.15.231是存在源端口唯一漏洞的被攻擊服務器IP。
發(fā)送查詢包的同時,在配置的權威名字服務器ns1.dnstest.com.cn 上,用tcpdump 等工具捕包,即可獲得被攻擊目標10.0.15.231的源端口號。如圖6所示。
至此,即可獲得緩存投毒攻擊的所需全部信息。3.4 Kaminsky緩存投毒攻擊實例
下面記錄了一次Kaminsky 攻擊前后的全過程。攻擊目標DNS 服務器:10.0.15.231,攻擊目。Kaminsky攻擊前,在目標DNS 服務器的緩存中,對域名的查詢結果如圖7。
可見,緩存中沒有關于域名的記錄信息。進行Kaminsky 攻擊,如圖8所示。
圖7 攻擊前緩存中記錄
Kaminsky 攻擊結束后,在目標DNS 服務器的緩存中,對域名dnstest.com.cn 的查詢結果如圖9。
3.5 緩存投毒攻擊存在的問題
對于源端口隨機性比較好的DNS 服務器[9],需要同時猜測TXID 和dport 字段,攻擊成功難度較大。
據(jù)緩存投毒攻擊原理,對已在目標DNS Cache 中的域名進行攻擊不能成功。
一個域名通常會有不止一臺權威名字服務器,對這樣的域名查詢時,會從多臺權威名字服務器中隨機選取一臺進行應答,而攻擊者無法估計選中的

是哪一臺,這就增加了攻擊難度。


2009.11
21
,China

Communications
V.結束語
DNS 在互聯(lián)網(wǎng)上應用廣泛,其安全性關系整個Internet 的穩(wěn)定。本文對傳統(tǒng)DNS 緩存投毒和新型Kaminsky 攻擊進行了討論分析,并提出了若干可行的防御策略。DNS緩存投毒攻擊還有很多未公開的應用領域,危害性很大,若與其他技術結合,破壞性更強。因此,從根本上解決DNS 緩存投毒攻擊,全面加強DNS 的安全,具有重要意義,這也是下一步研究的重點。
(英文全文請參見75頁)
圖9 攻擊成功后緩存中記錄
參考文獻
IV.DNS緩存投毒攻擊的防御策略
盡管傳統(tǒng)DNS 緩存投毒攻擊已出現(xiàn)多年,Kaminsky 漏洞攻擊也已經(jīng)公布了一年多,但實際上仍有相當一部分DNS 服務器沒有進行漏洞補丁修復。針對這種攻擊方式,可采取以下幾種可行的防御策略:
(1)DNS服務器中Bind 等軟件采用源端口隨機性較好的較高版本。源端口的隨機性可以有效降低攻擊成功的概率,增加攻擊難度。
(2)增加權威名字服務器的數(shù)量。據(jù)調查,國際和國內在權威名字服務器部署的數(shù)量方面近幾年均有所提升[5],但應進一步加強。
(3)在現(xiàn)有DNS 協(xié)議框架基礎上,引入一些技巧性方法,增強DNS 安全性。如在對DNS 應答數(shù)據(jù)包的認證方面,除原查詢包發(fā)送IP 地址、端口和隨機查詢ID 外,再增加其他可認證字段,增強認證機制。David Dagon等[2]就曾提出增加對查詢域名大小寫認證的算法,使DNS 服務器在收到應答數(shù)據(jù)包后,在原認證基礎上,再利用該算法對應答包與原查詢包中查詢域名大小寫進行比對,若匹配,則說明是正確應答包,否則可能為攻擊者偽造應答包,進一步增強了安全性。
(4)改進現(xiàn)有DNS 協(xié)議框架,例如在DNS 服務器上配置DNSSEC[8],或引入IPv6協(xié)議機制。DNSSEC 是專門保證DNS 安全的機制,試圖提升對應答數(shù)據(jù)包的弱認證方式以提高DNS 安全性。建立在IPv6協(xié)議上面的DNS 是一種全新的模式,目前尚處于理論階段,有待進一步實施。
[1]D.Dagon, M.Antonakakis, K.day, X.Luo, C.P.Lee, W.Lee: Recursive DNS Architectures and Vulnerability Implications. In Proceeding of The 16th Annual Network and Distributed System Security Symposium(NDSS 2009), San Diego, CA, February 2009.
[2]D.Dagon, M.Antonakakis, P.Vixie, T.Jinmei, and W.Lee: Increased DNS Forgery Resistance Through 0x20-Bit Encoding. In Proceedings of the 15th ACM Conference on Computer and Communications Security (CCS 2008), October 2008.
[3]Amit Klein: BIND 9 DNS Cache Poisoning. , 2007.
[4]Amit Klein: BIND 8 DNS Cache Poisoning. , 2007.
[5]王圭. 域名系統(tǒng)安全性研究[D]. 博士學位論文,哈爾濱工業(yè)大學,2007.
[6]J.Stewart: DNS Cache Poisoning—The Next Generation [EB/OL]. (2007-08-25). http://www.secureworks.com/research/articles/dns-cache-poisoning/.
[7]T.Olzak: DNS Cache Poisoning: Definition and Prevention [EB/OL]. (2006-03-02). infosecwriters.com .
[8]M. A n d r e w s : T h e d n s s e c l o o k a s i d e validation(dlv) dns resource record,rfc 4431.
, 2006.
[9]“Internet Systems Consortium BIND 9.4.1” (Internet Systems Consortium web page).
h t t p ://w w w. i s c. o r g /i n d e x. p l ? /s w /b i n d /view/?release=9.4.1
[10]K e t i l F r o y n : “D N S P o i s o n i n g ” (demonstration web page), 2003.
22 2009.11
,N ETWORK & INFORMATION SECURITY
網(wǎng)絡與信息安全
Principles and Defense Strategies of DNS Cache Poisoning
Jin Chong1, 2, Hao Zhiyu1, Wu Zhigang1
12
Institute of Computing Technology, Chinese Academy of Sciences, Beijing 100190 Graduate University of Chinese Academy of Sciences, Beijing 100190
Abstract : DNS is one of the most important basic infrastructures of the Internet, attacks on which will prevent the Internet from working properly. Therefore, its security is receiving great concern. This paper analyzes the principles of both tradi-tional and novel (Kaminsky) DNS cache poison-ing, presents attack samples and describes the whole attack process in detail. After verifying the potential harm of DNS cache poisoning, the paper gives out several defense strategies.
Key words: DNS; cache poisoning; Kaminsky at-tack
DNS server with the fake IP address information [6, 7]. This paper introduces the basic principles of both traditional and novel (Kaminsky) DNS cache poisoning and offers several defense strategies.
II. TRADITIONAL DNS CACHE POISON-ING
A DNS server only records all local authorized hosts. If the information of a host is to be queried, which is not local, a request message should be sent to the information holder (authoritative name server). To avoid the repetition for deliveries of such requests, the DNS server will save the results returned by the authoritative name server in the cache for a certain time, which constitute the DNS cache. By contaminating the DNS cache, namely replacing the real IP address information of hosts’ records in the cache with the fake IP address infor-mation, DNS cache poisoning causes damages.2.1 DNS ResolutionWe brie? y introduce the DNS resolution here be-fore analyzing the principles of DNS cache poi-soning, assuming that the domain name we are about to query is , namely the target domain name, and that the client as well as the default caching , namely default DNS server, meet the following conditions:
I. INTRODUCTION
DNS (Domain Name System) is a multi-level dis-tributed database system, whose basic function is to complete name resolution, namely providing a mapping relation between domain names and IP addresses, and therefore it brings much conven-ience to Internet users. DNS is the foundation and also one of the most successful applications of the Internet, and its security has drawn a lot of at-tention. DNS cache poisoning is one of the most hazardous methods in DNS attacks, which is also a hot topic in the research area. DNS cache poison-ing causes damages by replacing the real IP ad-dress information of hosts’ records in the cache of
2009.11
75
,China Communications

(1) The client and the default caching start up for the ? rst time so that there is no local cache information.
(2) The default caching name server is not the authoritative name server of the target domain name.
Figure 1 shows the query process. It works as follows:
(1) The client sends a request of recursive query of to the default caching name serv-er.
(2) The default caching name server checks its local records. If there is such information, it re-turns the authoritative answer; else, it will check its local cache and return the result to the client if there exists. If there is no such record in the cache either, it will send an iterative query to a root name server. According to the assumption above, in this example an iterative query is sent.
(3) The root name server returns the address of the authoritative name server of “cn” domain, namely the top-level name server, and the default caching name server keeps sending the iterative query to the top-level name server.
(4) The top-level name server returns the ad-dress of the authoritative name server of “ac.cn ” domain. The default caching name server keeps querying until getting the authoritative answer of . After that, it saves the authoritative answer in its local cache and returns the authorita-tive answer to the client, ? nishing this query proc-ess.
2.2 DNS Message Format
DNS protocol defines message formats for both
queries and responses. Most of the time it uses UDP protocol to transfer the data packets. Table 1(a) shows the message format of DNS queries, and Table 1(b) shows the message format of DNS responses.
2.3 Principles of Traditional DNS Cache Poison-ing
Currently, DNS adopts simple trust mechanism, which only veri? es the destination IP address, the destination port and the random query ID of the re-ceived response data packet, and never makes any analysis of the legality of the response data packet. If the three ? elds above match, the response packet will be accept as the real response data packet. The DNS server will go on with the rest of the DNS resolution process and ignoring all the response packets that arrive later. Therefore, an attacker could pretend to be the authoritative name server and send fake response packets. If one of the fake response packets arrives at the DNS server before the real one, sent by the authoritative name server, and the three fields of the fake packet match the source IP address, the source port and the random query ID of the original query packet, the attacker could successfully contaminate the cache of the DNS server. Figure 2 shows the process of tradi-tional DNS cache poisoning.

76 2009.11
,N ETWORK & INFORMATION SECURITY
網(wǎng)絡與信息安全
,China Communications

packet (Table 1(b)). Figure 4 shows the process of the Kaminsky attack.
(1) The attacker sends a DNS query to the name server to be attacked, in which the hostname is a combination of the target domain name and a ran-dom series, namely www276930.ict.ac.cn in Figure 4, in which ict.ac.cn is the target domain name and 276930 is the random series. Obviously the queried hostname doesn’t exist and the answer resource record in the response data packet returned should normally be NXDOMAIN (namely the hostname doesn’t exist).
(2) The attacked name server will make the que-ry according to the DNS resolution described in 2.1. At this moment, the attacker fakes response data packets (e. g. the red packet in Figure 4) and sends them to the attacked name server. If one fake data packet arrives at the attacked name server prior to the real response data packet (the black packet in Figure 4) and its destination IP address, destination port and random query ID successfully match the corresponding ? elds of the original query packet, the attacker succeeds.
(3) The answer resource record in the fake re-sponse data packet is the same as that in the real response data packet (NXDOMAIN, which means the hostname doesn’t exist), but the authority re-source record is the fake IP address of ns1.ict.ac.cn (1.1.1.1). Once the attacker succeeds, the author-ity resource record will be written into the cache of the attacked name server. During the time that the cache is valid, all queries of the domain names
belonging to the name server ns1.ict.ac.cn will be sent to the IP address (1.1.1.1) which is actually designated by the attacker.
3.2 Advantages of Kaminsky Attack
(1) As mentioned in 2.4, there are several de? cien-cies in traditional DNS cache poisoning, namely the long time needed for a successful attack and the low success possibility, however, the Kaminsky at-tack makes up for such de? ciencies. In the Kamin-sky attack, when continuously attacking a domain name, random series will be appended to the target domain name in each query, and thus there are no records for the domain name of each query in the attacked DNS cache. If one attack is not success-ful, the attacker could replace the random series with a new one and repeat the attack, in which the problem that the effective time in attacks is quite short no longer exists. In this way, the Kaminsky attack saves the attack time dramatically and in-creases the success possibility effectively.(2) If the traditional DNS cache poisoning succeeds, it only contaminates a hostname record in the attacked DNS cache. After that, only the query for the same hostname will be sent to the IP address designated by the attacker. However, if the Kaminsky attack succeeds, it contaminates the domain name record of an authoritative name server in the attacked DNS cache, and then queries of all hostnames ad-ministered by that authoritative name server will be sent to the IP address designated by the attacker. Therefore, the damage caused by Kaminsky attack is much worse.
3.3 Information Needed for DNS Cache Poison-ing Attack
3.3.1 Information Needed
Information needed in faking DNS response data packet should include two aspects: TCP/IP layer and DNS layer.
In TCP/IP layer, it should include srcip (IP ad-dress of the authoritative name server), dstip (IP address of the DNS server to be attacked), sport (port used by the authoritative name server, usually 53), and dport (port used when the attacked DNS server sends queries).
78 2009.11