News for hackers. Stuff that matters.
Re:Rapid DHCP: Or, how do Macs get on the network so fast? by tzs on Tuesday July 12, 2011 @06:55PM (#2756984)
As far as I can see from the RFC and from Googling, there is no mechanism for a DHCP server to take back an IP address before the lease has expired, unless the client explicitly initiates relinquishing the lease.

Once the address is given out, it is the client's for the term of the lease.

Re:Rapid DHCP: Or, how do Macs get on the network so fast? by saurik on Tuesday July 12, 2011 @07:07PM (#2757027)
Given that most routers are managing a class C network, and even then have allocated the first 100 addresses for internal use (starting the DHCP pool at .100), this would mean that it would be trivial to DoS any DHCP server in seconds by simply cycling MAC addresses and leasing all of their addresses.

Obviously, this is not realistic, and no one would ever implement a DHCP server that allowed this to happen: it is going to keep track of some fixed number of leases (probably/hopefully as many IP addresses as it is managing) and, when it runs out, it will be forced to reclaim an address from another user.

If anything, the fact that such a mechanism is not specified is simply going to make this "worse", as the specific implementation of how and when the reclamation happens is going to end up as "whatever makes sense to the guy working on that specific DHCP server implementation", and may constitute seemingly random behavior.

Re:Rapid DHCP: Or, how do Macs get on the network so fast? by brigade on Tuesday July 12, 2011 @07:56PM (#2757164)
You don't even need to cycle MAC addresses; just send DHCPDECLINE messages for any address the server gives. DHCP requires that any address that elicits that response from a client MUST be marked unavailable, and provides no provision for it ever becoming available again.

Ignoring the client is the only automatic mechanism DHCP provides for countering this.

You have to remember that DHCP was written back when it was assumed that a competent systems administrator managed the server and could manually respond to running out of available addresses (which was considered a likely sign of misconfiguration), and didn't attempt to specify what to do in the case where it happens.

Not giving out an address and notifying the systems administrator is what the DHCP spec recommends in this case. In fact, section 2.2 claims "The allocation mechanism (the collection of DHCP servers) guarantees not to reallocate that address within the requested time" so any reclamation of IP address on the part of the server is technically in violation of RFC 2131.

Re:Rapid DHCP: Or, how do Macs get on the network so fast? by saurik on Tuesday July 12, 2011 @08:34PM (#2757260)
I'm confused... are you therefore suggesting that this is how people like Linksys should handle this problem? I fully realize that the spec was written in another time, but I don't think tzs did: he is actually citing the spec as a reason why these leases should stay around. When you go to a coffee shop, the router does not and probably should not play a chime when it has run out of DHCP leases, causing the barista to go around the room finding laptops that have been setup incorrectly... the router should, and almost certainly does, just "figure something out", likely by reclaiming addresses.
Re:Rapid DHCP: Or, how do Macs get on the network so fast? by caf on Wednesday July 13, 2011 @01:27AM (#2757875)
There are sensible options available other than violating the leases.

For example, for a highly-used access point, it would make sense to give out only very short leases - say, 10 minutes. That'd support a churn of 25 clients per minute if you're giving out addresses from a /24 (and there's no reason why you couldn't use a smaller netmask, down to /8). It'd also be sensible to ignore a single MAC address once it had more than a handful of outstanding leases.

It doesn't help with a malicious client - but then neither does breaking leases. The malicious client can cause enough address flapping to make the network completely unuseable. You really can't protect a wifi network against a malicious client trying to DoS it - there's a myriad ways to do that apart from DHCP.

Re:Rapid DHCP: Or, how do Macs get on the network so fast? by Locke1689 on Tuesday July 12, 2011 @08:14PM (#2757217)
It's trivial to DoS any layer 2 network. This is trivial netsec.
Re:Rapid DHCP: Or, how do Macs get on the network so fast? by saurik on Tuesday July 12, 2011 @08:36PM (#2757271)
There is a fundamental difference between sitting on the network flooding it (an activity that requires you to actually be connected to the network, although this could of course be a small and difficult to detect device), and sending 256 packets and walking away, content in the knowledge that for the next 24 hours no one will be able to use the network because you own all of the DHCP leases. "This is trivial netsec."
Re:Rapid DHCP: Or, how do Macs get on the network so fast? by Locke1689 on Tuesday July 12, 2011 @08:41PM (#2757284)
I never said flood, I said DoS. I don't think this is on-topic so I'm not going to go in to detail but you should Google ARP spoofing. These tactics are quite trivial and I'm teaching undergrads to do it next year.
Re:Rapid DHCP: Or, how do Macs get on the network so fast? by saurik on Tuesday July 12, 2011 @08:46PM (#2757298)
I was, and continue to be, under the impression that this kind of attack is not possible when an access point has node isolation (a very common feature that even my MiFi router supports, despite it often being turned off in home and even office environments), yet the aforementioned protocol-level DHCP DoS I described would work on any device that implemented the DHCP specification. I therefore fail to see how ARP spoofing is relevant. Remember: we are discussing whether it is a fair belief that any reasonable implementation of DHCP would have implemented the spec as stated.
Re:Rapid DHCP: Or, how do Macs get on the network so fast? by sedev on Tuesday July 12, 2011 @08:15PM (#2757219)
That's where I'm at with this. What Jarek describes can happen, but that's a failure case, not the normal-operation case. And as portrayed in the article, the engineers at Apple have accounted for the failure case, so all's well. They simply have made the very reasonable assumption that the DHCP server will normally be operational, not in a crisis state, and that it will honor its contracts as specified in the RFC. How hard is this?
Re:Rapid DHCP: Or, how do Macs get on the network so fast? by jarek on Tuesday July 12, 2011 @08:48PM (#2757305)
There is that principle of "conservative in what you send, liberal in what you accept" on which UNIX and half of the internet was built.