rogue DHCP server

term

securitynetworking

Kept in this browser · My desk

A DHCP server that answers clients without authorization, most dangerously handing them a false default gateway or DNS resolver so that their traffic and name lookups pass through someone else.

DHCP has no authentication in practice: the client broadcasts its request, any server on the segment may answer, and RFC 2131 leaves the choice between offers to the implementation (often the first). RFC 2131 warned in 1997 that unauthorized servers 'may be easily set up' to send 'spoof routers' and 'spoof nameservers'. Most rogue servers are accidents (a home router, a laptop sharing its connection); some are malware. The defence is DHCP snooping on the access switches, which admits server messages only on trusted ports and builds the binding table that ARP inspection and IP source guard reuse.

What it is. Any device that answers DHCPDISCOVER or DHCPREQUEST messages on a segment where it is not the intended server. Ralph Droms wrote the problem into the protocol's own specification: section 7 of RFC 2131 (March 1997) calls DHCP 'quite insecure' and says unauthorized servers can send 'incorrect or duplicate IP addresses, incorrect routing information (including spoof routers, etc.), incorrect domain nameserver addresses (such as spoof nameservers), and so on', after which 'an attacker can further compromise affected systems'. The authentication option RFC 3118 defined in 2001 never spread; RFC 6104 described its use in 2011 as 'currently minimal'.

How it works. The client broadcasts DHCPDISCOVER to UDP port 67 with a random transaction ID. Every server on the segment hears it and may send a DHCPOFFER. RFC 2131 section 4.4.1 says the client 'collects DHCPOFFER messages over a period of time' and selects one, for example 'the first DHCPOFFER message or the DHCPOFFER message from the previously used server', by an 'implementation dependent' rule. It then broadcasts a DHCPREQUEST naming the chosen server in option 54, and the servers not chosen treat that as a decline (section 3.1). What the rogue offer carries is ordinary: option 3 (router), option 6 (DNS servers), option 15 (domain name), option 51 (lease time), and optionally option 121 classless static routes, which override option 3. Nothing is malformed, and the offer carries the client's own transaction ID because the question was broadcast.

History. In December 2008 Bojan Zdrnja of the SANS Internet Storm Center described a variant of the DNSChanger malware that installed the NDISProt driver to send raw Ethernet frames, watched for DHCPDISCOVER packets and answered with offers pointing at malicious DNS servers: 'a race between the rogue DHCP server and the legitimate one', with the infected machine findable only by the source hardware address of the offers. In March 2009 Johannes Ullrich reported a version that set one-hour leases and broadcast its replies. MITRE ATT&CK, which cites both, records the technique as T1557.003, DHCP Spoofing, created in March 2022, and notes the DHCPv6 variant (answering INFORMATION-REQUEST messages) and the exhaustion attack that floods DISCOVERs to empty the pool. The accidental case is as old: RFC 6104 records that Windows Internet Connection Sharing 'will typically start a rogue DHCPv4 server on the host'. In 2024 TunnelVision showed what a rogue server can do to VPN (virtual private network) users through option 121.

In practice. DHCP snooping, as Cisco's TAC (Technical Assistance Center) document 217055 (June 2024) describes it, 'acts as a firewall between untrusted user ports and DHCP server ports': untrusted interfaces block DHCPOFFER, DHCPACK, DHCPNAK and DHCPLEASEQUERY, and the switch records each lease (hardware address, IP address, lease, VLAN, port) in a binding table 'also used by other IOS security features such as Dynamic ARP Inspection and IP Source Guard'. Juniper ships it off by default and, when enabled, treats access ports as untrusted and trunks as trusted, so the trusted set must be chosen deliberately. Rate limiting on untrusted ports answers exhaustion. Windows Server adds authorization in Active Directory: unauthorized Windows DHCP servers in a domain stop leasing, but the check binds only Windows servers that participate in the domain.

What goes wrong. Snooping enabled with every uplink trusted lets a rogue server reached through a trunk through; option 82 inserted by a switch that is not a relay can make servers drop requests; and networks that ignore IPv6 leave the DHCPv6 and Router Advertisement equivalents wide open. Detection is by knowing the legitimate servers: two OFFERs for one transaction ID with different server identifiers, a router or resolver that differs from the scope, short leases, and hosts sending DNS queries to resolvers the network never handed out.

Neighbours. DHCP snooping, DHCP option 82 and the relay agent, DHCPv6-Shield and RA Guard for IPv6, dynamic ARP inspection and IP source guard, which reuse the binding table, and ARP poisoning, the other classic way to become the gateway.

Also known as: rogue dhcp, dhcp spoofing, unauthorized dhcp server, servidor dhcp falso

Sources

← Back to R Back to the glossary