43

Over the last 3-4 weeks I have been trying to find a rogue DHCP server on my network but have been stumped! It is offering IP Addresses that do not work with my network, so any device that needs a Dynamic Address is getting one from the Rogue DHCP and then that device stops working. I need help to find and destroy this thing! I think it might be a Trojan of some sort.

My Main Router is the only valid DHCP Server and is 192.168.0.1 which offers a range of 192.160.0.150-199, and I have this configured in my AD as Authorized. This ROGUE DHCP claims to be coming from 192.168.0.20 and offering an IP Address in the range of 10.255.255.* which is messing up EVERYTHING on my network unless I assign a static IP Address to it. 192.168.0.20 does not exist on my network.

My network is a single AD Server on Windows 2008R2, 3 other physical servers (1-2008R2 and 2 2012R2) about 4 Hypervisor VM's, 3 laptops and a Windows 7 box.

I can't ping the rogue 192.160.0.20 IP, and I can't see it in the ARP -A output, so I can't get its MAC address. I'm hoping that someone reading this post has come across this before.

Brian
  • 230
Dave Stuart
  • 760
  • 7
  • 12
  • 12
    I'm no help on the windows side but if I was on Linux, I'd simply take a packet capture with tcpdump on a client as it obtained a bad dhcp lease. The packet capture should have the mac address of the system that sent the offer. Trace that. –  Aug 15 '17 at 02:37
  • 7
    Can you unplug everything and put things back on the network one at a time? – R. S. Aug 15 '17 at 02:45
  • 1
  • You can likely see the MAC of the rogue server (if the trojan didn't change it), and - if you don't have a list from the MACs of your clients - then you can grep for it in your earlier (yet clean) DHCP logs. 2) If nothing other works: plug out half of the machines from the net, check if he still is here. So you will know, in which half is the bad guy. Then so the same in found half, and so on.
  • – peterh Aug 15 '17 at 04:16
  • Isn't there a way on the switch to disable dhcp on ports? I thought there was. – curious_cat Aug 15 '17 at 07:34
  • @curious_cat - the only way to disable rogue DHCP servers at the switch level is to employ a switch that has DHCP snooping (that's the Cisco terminology). A single port can be configured to be a "trusted" DHCP port (which your trusted DHCP server should be connected to) and it will be the only port to allow DHCP requests through. All other ports can then block the requests - thus eliminating rogue DHCP server situations. Managed switches with this functionality are a must-have for networks with untrusted users/devices. – Kinnectus Aug 15 '17 at 09:22
  • Exactly. That's what I meant. It seems like a robust solution to this problem. – curious_cat Aug 15 '17 at 09:24
  • 4
    What router? It could be that the router itself is infected. – J... Aug 15 '17 at 10:22
  • 1
    What type of switch do you have? managed or unmanaged? Brand? Model? Depending on the capabilities of the switch you might have some more possibilities how to solve the problem. – Raffael Luthiger Aug 15 '17 at 16:49
  • Are you running a VPN server somewhere? Usually VPN's put connections on a different subnet and then build routes to allow them to talk... maybe it's misconfigured and offering it's DHCP onto your regular subnet instead of only to VPN users. – SnakeDoc Aug 15 '17 at 21:14
  • @yoonix You can do that with Wireshark or similar on Windows (or your own program using WinPCAP, if you prefer.) – reirab Aug 15 '17 at 22:26
  • @peterh Even if the MAC address had been changed by a trojan, it must still be one that works on the network, otherwise the DHCP handshake would fail. – reirab Aug 15 '17 at 22:28
  • @reirab ...and so will be known, that the rogue is in the switched off half... – peterh Aug 15 '17 at 23:02
  • DHCP by design shouldn't work cross-subnets - unless a relay agent is specifically configured. So the request for a DHCP lease should not make it across the VPN unless an agent pushes it across. DHCP snooping (or equivalent) is definitely the best option to stop this long term. – Shane Aug 16 '17 at 07:44
  • @MatthewWetmore I don't think it is a duplicate. That question is about how to detect the presence of a rogue DHCP server. This question is about how to find out where it is once its presence on the network is already known. – kasperd Aug 16 '17 at 23:06
  • @kasperd, yeah, I'll go with you on that. There was some indirect stuff that overlapped with wireshark and finding the MAC - which is one of the issues in this question. But this does go a bit further/better on getting it down to the port on the switch. Good catch, thanks. I'm not sure how to unflag - possibly just deleting the auto-generated comment by flagging? – Matthew Wetmore Aug 17 '17 at 05:39
  • @Shane My comment was more along the lines of a VPN Endpoint/Router combo that had a wrong configuration and decided to offer 2 DHCP server's on the same subnet, but for different DHCP address pools... not some VPN user pushing DHCP into the network. – SnakeDoc Aug 17 '17 at 15:44