how to send discover packet and receive a new ip address offer form DHCP server?

29 views
Skip to first unread message

Ho Yeung Lee

unread,
May 23, 2017, 7:37:48 PM5/23/17
to scrapy-users
if not set requested address, 

after set a fake mac address and create a mapping in switch, 
it just loading and timeout and no content in reply packet in responsepkt

why can not get one more new ip address?

def custom_action(packet):
        packet[Ether].src = '82:d2:44:25:5d:83'
        #packet[DHCP].requested_addr = '10.126.0.38'


send(Ether(src="82:d2:44:25:5d:83", dst="ff:ff:ff:ff:ff:ff")/IP(src="10.126.0.160", dst="8.8.8.8")/UDP(dport=53)/b"hello")
sendp(Ether(src="82:d2:44:25:5d:83",dst="FF:FF:FF:FF:FF:FF")/ARP(op=2, psrc="0.0.0.0", hwdst="FF:FF:FF:FF:FF:FF")/Padding(load="X"*18))
packets2 = sniff(offline=r'C:\Users\martlee2\Downloads\dhcp.pcap', prn=custom_action)
responsepkt = sr1(packets2[0],timeout=2,verbose=0)
responsepkt 

Reply all
Reply to author
Forward
0 new messages