DNS Cache poisoning | Complexity is the enemy of Security http://blog.lifeoverip.net Life (Over) IP, Mon, 12 Jan 2009 21:14:35 +0000 en-US hourly 1 Nmap NSE kullanarak DNS Cache Poisoning Zafiyeti Testleri http://blog.lifeoverip.net/2009/01/13/nmap-nse-kullanaran-dns-cache-poisoning-zaafiyeti-testleri/ http://blog.lifeoverip.net/2009/01/13/nmap-nse-kullanaran-dns-cache-poisoning-zaafiyeti-testleri/#comments Mon, 12 Jan 2009 21:14:35 +0000 http://blog.lifeoverip.net/?p=907 Bir önceki blog girdisinde NSE’in faydalarından ve basit kullanımından bahsetmiştim. Şimdi de çeşitli NSE scriptlerini kullanarak manuel ya da scriptlerle yaptığımız işleri Nmap’e nasıl havale edeceğimize bakalım. Ilk test sistemlerin DNS cache poisoning’e açık olup olmadığını test etmek. Bugün yaptığım … Continue reading

The post Nmap NSE kullanarak DNS Cache Poisoning Zafiyeti Testleri first appeared on Complexity is the enemy of Security.

]]>
Bir önceki blog girdisinde NSE’in faydalarından ve basit kullanımından bahsetmiştim. Şimdi de çeşitli NSE scriptlerini kullanarak manuel ya da scriptlerle yaptığımız işleri Nmap’e nasıl havale edeceğimize bakalım. Ilk test sistemlerin DNS cache poisoning’e açık olup olmadığını test etmek. Bugün yaptığım bazı testler sonrası bu konunun oldukça önemli olduğunu anladım. Hatta derdimi anlatacak birileri bulsam tüm Türkiye’nin ip aralığını alıp bu testten gerçirmek isterdim ama arada bir arıza çıkar da sen bizim networkümüzü hangi hakla tararsın(Taramak? DNS sunucusuna çeşitli istekler göndermek illegal mıdır?) diye söylenir diye bu fikrimden şimdilik vazgeçtim.

İçinde birden fazla DNS sunucu barındıranların kendi sistemlerini test etmeleri için buraya Nmap ile testlerin nasıl yapılacağını yazayım belki birilerine faydası dokunur.
Dns cache poisoning açıklığını test etmek için hedef sistemde iki değer kontrol edilir. Birincisi dns sorgulamalarında kaynak portun değiştirilmesi, diğeri de dns sorgularındaki TXID değerinin yeteri kadar random/rastgele olması. Nmap ile bu iki değeri de kontrol edebiliriz. Hatta tek bir taramada her ikisi de kontrol edilebilir.

Önce kaynak port rastgeleliğini test edelim.

# nmap -P0 -sU -p 53 –script dns-random-srcport 100.100.100.2 -vv

Starting Nmap 4.76 ( http://nmap.org ) at 2009-01-12 11:14 GMT
Initiating Parallel DNS resolution of 1 host. at 11:14
Completed Parallel DNS resolution of 1 host. at 11:14, 0.00s elapsed
Initiating UDP Scan at 11:14
Scanning (100.100.100.2) [1 port]
Completed UDP Scan at 11:14, 2.02s elapsed (1 total ports)
SCRIPT ENGINE: Initiating script scanning.
Initiating SCRIPT ENGINE at 11:14
Discovered open port 53/udp on 100.100.100.2
Completed SCRIPT ENGINE at 11:14, 5.83s elapsed
Host host- (100.100.100.2) appears to be up … good.
Scanned at 2009-01-12 11:14:39 GMT for 8s
Interesting ports on (100.100.100.2):
PORT STATE SERVICE
53/udp open domain
|_ dns-random-srcport: 100.100.100.2 is POOR: 52 queries in 108.6 seconds from 1 ports with std dev 0

Read data files from: /usr/local/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 8.04 seconds
Raw packets sent: 2 (56B) | Rcvd: 0 (0B)

Benzer şekilde txid üretecinin tahmin edilebilirligini test etmek için

# nmap -P0 -sU -p 53 –script dns-random-txid 100.100.100.2 -vv
komutu kullanılabilir.

bt scripts # nmap -P0 -sU -p 53 –script dns-random-txid 100.100.100.5 -vv

Starting Nmap 4.76 ( http://nmap.org ) at 2009-01-12 11:50 GMT
Initiating Parallel DNS resolution of 1 host. at 11:50
Completed Parallel DNS resolution of 1 host. at 11:50, 0.10s elapsed
Initiating UDP Scan at 11:50
Scanning 100.100.100.5 [1 port]
Completed UDP Scan at 11:50, 2.02s elapsed (1 total ports)
SCRIPT ENGINE: Initiating script scanning.
Initiating SCRIPT ENGINE at 11:50
Discovered open port 53/udp on 100.100.100.5
Completed SCRIPT ENGINE at 11:50, 5.80s elapsed
Host 100.100.100.5 appears to be up … good.
Scanned at 2009-01-12 11:50:48 GMT for 8s
Interesting ports on 100.100.100.5:
PORT STATE SERVICE
53/udp open domain
|_ dns-random-txid: x.y.z.t is GREAT: 26 queries in 5.3 seconds from 26 txids with std dev 17822

Read data files from: /usr/local/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 8.09 seconds
Raw packets sent: 2 (56B) | Rcvd: 0 (0B)

Her iki testi de tek bir Nmap taraması ile gerçekleştirmek için scriptler arasına “, ” koyulması yeterli olacaktır.

Nmap tarafından dns ile ilgili yapılabilecek diğer taramalar.

bt scripts # ls dns*
dns-random-srcport.nse dns-random-txid.nse dns-recursion.nse dns-test-open-recursion.nse dns-zone-transfer.nse

The post Nmap NSE kullanarak DNS Cache Poisoning Zafiyeti Testleri first appeared on Complexity is the enemy of Security.

]]>
http://blog.lifeoverip.net/2009/01/13/nmap-nse-kullanaran-dns-cache-poisoning-zaafiyeti-testleri/feed/ 10