Has anyone had success writing a DHCP discovery program?
I've been fiddling with a program in C# for a few months now with the goal of discovering dhcp servers.
I'm using Winpcap/SharpPcap as the methods.
I THINK the program code is fine.
I'm able to capture DHCP packets and disassemble them to study the individual DHCP fields.
My problem is that I can't seemingly create a DHCP discover/request packet that a dhcp server would respond to (in this case my router). I'm thinking the problem is with DHCP options. The length of the packet is correct (when compared to a packet captured from ipconfig /renew). And when I look MY custom request packet, I can disassemble it properly and see all the DHCP packet fields, and can even get correct Ethernet, IP, and UDP header lengths.
I'll post code if requested, but I'm just looking to see if anyone has had success doing this, and how did you generate a custom discover/request packet?
