<div dir="ltr"><div><div><div><div><div><div><div>I am currently doing some testing with DHCP Spoofing and DHCP Starvation attacks. When performing the starvation attack with pig.py, I noticed that dnsmasq keeps assigning the same IP addresses over and over again with consecutive runs. That is potentially great from a security point of view but not what I had in mind (I wasn't testing dnsmasq's resiliency)<br><br></div>I was testing with this command line:<br>dnsmasq --no-daemon --dhcp-range=10.0.10.50,10.0.10.100,5m --dhcp-option=option:router,10.0.10.1<br><br></div>First thing you will think now is, dnsmasq does a ping check after assigning an IP address and when no reply is received, the address goes back to 'available'. pig.py doesn't actually start listening on the received IP addresses so no ping will ever be returned.<br>That's what I thought to, so I tried using the --no-ping option to try and disable this behaviour. And started running pig.py in an endless loop.<br><br>dnsmasq --no-ping --no-daemon --dhcp-range=10.0.10.50,10.0.10.100,5m --dhcp-option=option:router,10.0.10.1<br><br></div>This seemed to work, I got messages telling 'no address available' in the dnsmasq log output. After a while though, IP addresses where assigned again, and again, and again... No help there. Of course, I dove into the dnsmasq source and found out that after assigning an addres via DHCP, the address gets 'blacklisted' for thirty seconds, after which it automatically becomes available again, unless a ping response has been received in the mean time.<br><br></div>The --no-ping option disables the actual pinging but doesn't disable the thirty second timeout. Thus <b>all</b> assigned IP addresses become available again after just 30 seconds using this option! Not only does this count as unexpected behaviour (in my eyes), this also tells me that when my servers won't respond to ping calls, their IP addresses will be free-for-all after just thirty seconds! <br><br></div>I don't know what to expect when a server doesn't reply to a ping using normal dnsmasq options, but when the --no-ping option is set, I expect dnsmasq to return to the default behaviour of expiring addresses only after lease-time has expired. This sounds like a bug to me. Is this by design, am I doing something wrong or is this really a bug?<br><br></div>Kind regards,<br></div>Peter Overtoom<br></div>