Hi, on the network of the office where i work there is a DHCP server, but in the last days i often receive a wrong address (192.168.40.128) from another unknown DHCP server (192.168.40.254).
I tried to prevent this from happen with Comodo Firewall, but it doesn’t seem to work.
I tried with different global rules, but no way.
Now i have these rules active as the first three:
Deny and Log
Protocol = UDP
Direction = In
Source Address = IPv4 Address [192.168.40.254]
Destination Address = Any
Source Port = A Port Range [67 - 68]
Destination Port = A Port Range [67 - 68]
Deny and Log
Protocol = TCP or UDP
Direction = In
Source Address = IPv4 Address range [192.168.40.0 192.168.40.255]
Destination Address = Any
Source Port = Any
Destination Port = Any
Deny and Log
Protocol = TCP or UDP
Direction = In/Out
Source Address = MAC Address [00-50-56-FF-C0-D4]
Destination Address = Any
Source Port = Any
Destination Port = Any
But if i release and renew, i receive again the same weird address… what can i do?
Yes, sure that’s the first thing i did.
But as our network admin is quite slow to react, i wanted meanwhile to take advantage of the situation to learn better using the firewall and block the (supposed) rogue DHCP myself…
That’s a tricky thing as the DHCP offer is part of the DHCP Request outgoing allowed by svchost.
At that point CIS decides to allow the traffic back in… I doubt this is possible in the current state CIS is allowing the “stateful traffic back in”.
I should have to fiddle around a bit with CIS and wireshark to see if this is even possible…
There are two possibilities I can think of that might offer a temporary solution.
A. If you are certain the IP address of the 'rouge ’ DHCP server is 192.168.40.254, create a rule for svchost (in Application rules) that explicitly blocks UDP out to that address. Because of the nature of DHCP, which uses a limited broadcast to find DHCP servers, if communication fails to/from the first responder, it will give any other DHCP servers a chance to allocate.
B. If you know the IP address of the genuine DHCP server, create an explicit rule for svchost that uses UDP out to the DHCP servers address on port 67 and then block all other UDP communication for svchost on port 67.
This latter option has more potential pitfalls the former, again, because of the nature of the communication between DHCP client and DHCP server. It’s certainly worth a try, however.
I tried every possible option IP, MAC, In, Out etc and even ARP poison the local host… Nothing blocked this…
I’m going to ask Dev’s if this is “by-design”…
@Radaghast
Nothing to do.
I tried the “A” but it doesn’t work… and in wireshark i see the packets going forth and back without problems…
I tried the “B” but if i block the UDP on 67 outwards it doesn’t get an address at all because it blocks even the DHCP DISCOVER…
@Ronny
But is it possible that for the stateful nature of the firewall, the initial broadcast is considered a session initiation, even if it doesn’t contain the IP address of the destination?
Thanks to both of you for the support…
ciao
Andrea
In some cases the value stored in this key can prevent the proper functioning of the release/renew commands. There are ways around this, which if implemented, may allow for the blocking of the ‘rouge’ server as outlined above, but still allow a local broadcast on UDP 255.255.255.255:67 to find the ‘real’ DHCP server
For what it’s worth, I was able to simulate this on my LAN. By blocking IP out to the rogue DHCP server, but allowing a local broadcast on 255.255.255.255:67, I was able to pick up an address from my chosen DHCP server.
I usually use the router for DHCP, but for this exercise I turned on the DHCP service on my Windows 2008 server box. This placed two DHCP servers on the LAN, both offering slightly different scopes. Without making any changes to the svchost rules, a release/renew always received an address from the router. This is due to the registry settings.
To prevent this behaviour, I blocked all out-going activity to the router but allowed a local broadcast on port 67. Using this method, the test PC was able to obtain address from the 2008 DHCP server. I was also able to reverse the situation by blocking the 2008 DHCP server and obtaining an address from the router.
In fact i don’t understand how it could work, as it wasn’t so different from the previous attempts i made… if i analyze the traffic with wireshark i don’t see any packet going directly to the DHCP Server, both the DISCOVER and the REQUEST are broadcast, so they are allowed to pass…