Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from scapy.all import *
- conf.checkIPaddr = False
- fam,hw = get_if_raw_hwaddr(conf.iface)
- def dhcp_discover(resp):
- print "Source: " +resp[Ether].src
- print "Dest: " +resp[Ether].dst
- for opt in resp[DHCP].options:
- if opt == 'end':
- break
- elif opt == 'pad':
- break
- print opt
- sendp(Ether(dst="ff:ff:ff:ff:ff:ff")/IP(src="0.0.0.0",dst="255.255.255.255")/UDP(sport=68,dport=67)/BOOTP(chaddr=hw)/DHCP(options=[("message-type","discover")]),count=3)
- sniff(filter="udp and (port 67 or 68)", prn=dhcp_discover, store=1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement