Softpanorama

May the source be with you, but remember the KISS principle ;-)
Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and  bastardization of classic Unix

DHCP Security

News

Solaris DHCP

Recommended Links Classification of attacks on DHCP Defense Recommendations Reference Humor Etc

DHCP is built directly on UDP and IP which are as inherently insecure. Furthermore, DHCP is generally intended to make maintenance of remote and/or diskless hosts easier. While perhaps not impossible, configuring such hosts with passwords or keys may be difficult and inconvenient. Therefore, DHCP in its current form is quite insecure.

Unauthorized DHCP servers may be easily set up. Such servers can then send false and potentially disruptive information to clients such as incorrect or duplicate IP addresses, incorrect routing information (including spoof routers, etc.), incorrect domain nameserver addresses (such as spoof nameservers), and so on. Clearly, once this seed information is in place, an attacker can further compromise affected systems.

Malicious DHCP clients could masquerade as legitimate clients and retrieve information intended for those legitimate clients. Where dynamic allocation of resources is used, a malicious client could claim all resources for itself, thereby denying resources to legitimate clients.

The discussion below is based on an excellent paper Network Penetration.com/Flaws within the Dynamic Host Configuration Protocol by Ste Jones

DHCP is used to automatically configure machines with an IP address so that the hosts do not have to be statically assigned IP addresses. For a clients NIC to be assigned an IP address the DHCP packet exchange is as follows

  1. The client sends a DHCP discover packet, indicating that a clients interface requires a IP address from a DHCP server. The clients interface may ask for its previous IP address from the server, this may cause problems with the man in the middle attack (explained later).
  2. The server sends a DHCP offer packet, informing the client of what IP address is on offer. The IP address being offered may or may not be the one requested (if the interface asked for a specific IP address with the discover packet) depending on how busy the network is. If the network is busy then the IP address requested with the discover packet may have already been re-assigned to a different interface, thus a different IP address will be offered.
  3. The client sends a DHCP request, informing the DHCP server that the clients NIC wishes to be assigned the IP address sent by the servers offer.
  4. The server sends a DHCP ack, acknowledging that the NIC has sent a request for a specific IP address. At this point the clients interface assigns / binds the IP address from the DHCP servers offer packet in step two.

Once this sequence of packets occurs a client has been assigned an IP address and probably a default gateway and DNS server. Numerous options can be set by the DHCP server, for a full list consult the RFC documentation.

Classification of attacks on DHCP

If attackers are able to compromise a DHCP server on the network, they might disrupt network services, preventing DHCP clients from connecting to network resources. By gaining control of a DHCP server, attackers can configure DHCP clients with fraudulent TCP/IP configuration information, including an invalid default gateway or DNS server configuration. There are several avenues of attack of this protocol some trivial and some less so:

Defense Recommendations

Top Visited
Switchboard
Latest
Past week
Past month

NEWS CONTENTS

Old News ;-)

[Jan 5, 2007] freshmeat.net Project details for Rogue Detect

Rogue Detect sends DHCPDISCOVER packets to the network and listens for DHCP servers to respond. It can run continuously as a daemon, or do a single probe and quit. It's written in Perl and can be easily extended to take any action you can think of in response to an unknown DHCP server (send pages, disable them, etc).

[Jan 5, 2007] Bounty Source - Rogue Detect - Wiki

DHCP Server Detection

The library and simple script included are made possible by Oregon State University Open Minds. Open Doors. Open Source. http://oregonstate.edu

Quick and Easy

Requirements:

I've only tested this with the one box I wrote it on at this point, its Debian Linux (woody-though with some sid/unstable packages installed)

I don't see any reason it wouldn't work elsewhere though.

INSTALL

dhcpdetect has two modes available: continuous scan mode, and single scan mode (default).

Single Scan mode is good for running from the commandline periotically or from a cron script, while Continuous mode is good for letting the detector run indefinately.

Syntax:

dhcpdetect.pl --continuous [--freq=x] [--iface=interface] [--nodaemon] [--debug=x] 
OR
dhcpdetect.pl [--waitfor=x] [--iface=interface] [--debug=x]

  --continuous          Cause the program to run in a loop, sending DHCPDISCOVER occationally
                        and listning for replies
  --nocontinuous        (default) Send only one DHCPDISCOVER and wait only long enough for
                        a response. Then quit. (for commandline or crontab use)
  --freq=x              In continuous mode only: how long between DHCPDISCOVER packets
  --waitfor=x           In normal (non-continuous) mode only: how long to wait after
                        sending a DHCPDISCOVER for replies.
  --iface=interface     Network interface to use (eg eth0). Unfortunately only one
                        can be done at a time (sorry) run multiple copies for now.
  --daemon/--nodaemon   in continuous mode only: wether or not the program should
                        fork and go into the background. Default is yes.
  --debug=x             Debug level. 1-5 supported. 3 is good for info. higher levels
                        give more information.

Bugs

Notes

Sending a DHCPDISCOVER packet causes any DHCPSERVERS listning to allocate an IP address for a few seconds, while they wait for the detector to ACK their offer. Since we never do send an ACK, the IP is not allocated to us. Hence, it should be ok to run this on the network.. but do so at your OWN RISK!!

This package is nice in that you do not have to have a clear view of the network to run it (ie, it works behind a switch). You DO have to be within broadcast range, which usually means on the same subnet as the DHCP server. In some cases scaning port 68 (67?) on every machine may be the better answer to finding dhcp servers, but with this program, as apposed to a passive one like snort, you do not have to be able to see traffic not destined for you.

Our resnet has 19 subnets, so I use a linux box with 19 aliased interfaces in addition to its onboard network.In linux they are eth1, eth2.0132, eth3.0133, etc… so I must run 19 copies of dhcpdetect.pl, one for each interface.

If you have questions please contact us at https://roguedetect.bountysource.com Alex Schumann, Karl Vollmer

[Dec 21, 2006] Problems Detecting Rogue DHCP Servers on Linux UPDATE

Dec 21, 2006

I have finally found a tool that works for RHEL and Debian (and probably all Linuxes). It's a Perl module and accompanying script which can optionally be run as a demon and be setup to email you each time it finds a rogue server. It's called RogueDetect and is GPL. I have tested version 0.4Alpha2. I've also used this code as a basis for a Nagios plugin the code for which I'll be releasing over the next few days on this blog.

Good post bart, nice to see that windows has some decent commands relating to standard internet protocols. In the longer term, you could have a permanent method of spotting rogue dhcp servers. I found a rule for snort:

#
# DHCP Servers
#
alert udp !$DHCP_SERVERS 67 -> 255.255.255.255 any (msg: "possible rogue DHCP Server"; sid:1000001;)

I know you use nagios, I dunno if theres a plugin for that yet.

[Dec 20, 2006] Problems Detecting Rogue DHCP Servers on Linux

I am by no means shy about pointing out problems with Windows on this blog but I do try to be objective in my criticism. Today I have the rare pleasure of sharing a Windows command-line tool that I haven't been able to find an equal to on RedHat Enterprise Linux (RHEL) 4. A few weeks ago a rogue DHCP server caused us some serious problems at work so I was asked to find a simple tool for detecting rogue servers. In theory there are loads of tools for this on Linux but after having tried everything Google was able to find for me (an entire day's work) I'd still drawn a blank. Everything I tried insisted that our main DHCP server did not exist. What's more tcpdump showed responses from the DHCP server arriving at the machine but all the tools insisted they got no reply regardless. In my search I did come across dhcploc.exe, a small MicroSoft command-line tool that ships with most versions of Windows. Granted, it's not part of the default install but it is on the CD none the less and more importantly it works!

Technorati Tags: Windows, RedHat, RHEL, DHCP, Rogue DHCP Servers

To install dhcploc.exe you have to install the Support Tools which you have to look for on your Windows CD. Once you have this installed you can set it looking for rogue servers with the following command:

dhcploc 

dhcploc.exe will then run continually and display all DHCP responses it sees. It will beep each time a rogue server is seen. You can also get it to only show you rogue traffic with the -p flag.

It's rare that Windows has more powerful command-line tools than Linux but when it comes to detecting rogue DHCP servers Windows had it nailed with this simple tool that just works! I just hope this tool still exists in Vista!

Update 21 December 2006

I have finally found a tool that works for RHEL and Debian (and probably all Linuxes). It's a Perl module and accompanying script which can optionally be run as a demon and be setup to email you each time it finds a rogue server. It's called RogueDetect and is GPL. I have tested version 0.4Alpha2. I've also used this code as a basis for a Nagios plugin the code for which I'll be releasing over the next few days on this blog.

[Oct 27, 2006 ] DHCP Server Security (Part 2) Detecting Rogue DHCP Servers

Finally, there are a few tools you can use to detect the presence of rogue DHCP servers on your network so you can get rid of them. These include both tools from Microsoft and from third-party sources, and we'll end by examining two of these tools.

Dhcploc.exe

Dhcploc.exe is a command-line tool that is part of the Windows Support Tools found in the \Support\Tools folder on your Windows XP product CD and it can be used to display all DHCP servers that are active on the local subnet. Dhcploc.exe has been around since Windows NT 4.0 and it works by sending out DHCPREQUEST messages and displaying the IP addresses of the DHCP servers that responded with DHCPACK. You can find the syntax of this tool in the Help file that is installed when you install the Support Tools on your machine.

dhcp_probe

The Network Systems Group at Princeton University's Office of Information Technology has developed a tool called dhcp_probe that tries to discover DHCP and BOOTP servers on a directly-attached Ethernet network. The existing build runs on Solaris 8 on SPARC with gcc and there is patch for it to work on Linux also, so if you have either of those platforms you can try using this tool to detect any rogue DHCP servers that might be running on your network. You can find the Network Systems Group's tools page here and can download dhcp_probe directly from here.

[Nov 22, 2006] DHCP at SLAC

Roaming DHCP - for registered laptops on the SLAC network
Roaming DHCP allows the laptop user to connect his registered laptop to network taps on different subnets of the SLAC internal network. There is no DHCP service for desktops. There is no wireless networking on the SLAC internal network.

The MAC address of the laptop must first be registered with the DHCP server. After the laptop is registered and connected to the SLAC network the DHCP server will dynamically assign it a SLAC IP address and other network configuration information.

As long as the laptop is connected to the network the lease will not expire and the laptop will keep the assigned IP address. If the laptop disconnects from the network the lease will expire after the lease time is up and the IP address will be freed up to be used by another DHCP client. The laptops lease will have to be renewed the next time the laptop is connected to the network. The lease time is 1 hour.

If a registered MAC address is not used for 9 months it will be removed from DHCP and will need to be registered again.

Policy and Security Guidelines to be followed
The group desktop administrator should determine that the laptop meets current security requirements set by SLAC Computing Security before registering the laptop for DHCP. In order to keep your DHCP registration, your machine must keep up-to-date with these security requirements, or else your DHCP registration will be revoked.

For Windows:
Before requesting DHCP you are required to read and implement the
Windows at SLAC guidelines, including the Guidelines for Connecting Computers to SLAC Internal Network . Check with your Desktop Administrator for help.

For Linux:
Before requesting DHCP you are required to read and implement the Linux at SLAC guidelines. For help check with unix-admin@slac.stanford.edu .

How to get your laptop registered for Roaming DHCP
Contact a DHCP Czar who works in your group or your area and provide him with the DHCP Registration Information listed below. He can register it for you.

All other requests should be sent to dhcp-admin@slac.stanford.edu .

Copy and paste the DHCP Registration Information and your responses to your email:

DHCP Registration Information (all information is required):
* = Name must be in the SLAC Phone Book

Visitor DHCP - for unregistered laptops on the visitor network (for SLAC visitors)
Visitor DHCP allows SLAC visitors a quick and easy connection to the Internet to read email, connect to hosts at home institutions, and browse the web. This connection is on the visitor network, located outside the SLAC internal network and firewall, and restricts access to many SLAC network services.

No registration is needed. Users simply need to find a network tap configured for the visitor network and connect their laptop to it. Currently there are visitor taps located in the Auditorium, many conference rooms, and other locations at SLAC. Check with your Desktop Administrator for specific locations.

The visitor network also supports wireless networking. See the SLAC wireless web page for more information.

Temporary DHCP - for system administrators for new machine configuration
Temporary DHCP is used by authorized system administrators, who are also DHCP Czars, to allow them to configure new machines on the network. The lease period for temporary DHCP expires at midnight of the day it's acquired.

[Oct 30, 2006] TechRepublic/DHCP – An administrator's delight or a security issue.

I can well understand with large networks the ability to configure new PC's and it on the network and have the convenience of DHCP issue a valid IP and DNS server as a very very useful tool.

However, how many of use consider the security repercussions of handing out access to you total network just by the action of plugging a PC in.

The problem gets worse as the lager you network the more likely you will be dependant on DHCP.

From my point of view if you have a small to moderate Network you should NEVER use DHCP to hand out the keys to you network to anyone who plugs in a PC and the only thing that separates the newly plugged in PC is a password and user name.

It is very very hard to keep track of all the wired access points in your office and so the threat compounds itself.

Security threats come i all different types and we should never forget the internal threat any possibly has by just plugging a PC or laptop into ANY RJ socket.

If you network not a never ending story in its size managing it without DHCP should be a major consideration.

If you cannot live without automatically assigning IP's then DONT hand out DNS servers for free. This can be a compromise for large expansive networks.

The other issue to consider is the use of different routes available on you network. I can not image being asked as a security consultant NOT to plan different routes depending on the level of security you need.

NOT every PC needs to have access to each other. All that is needed is your severs ability to see everyone. Defining different routes by not using DHCP on every one or using DHCP and defining different routes using differing subnet masks is an option here.

For a real world issue having Management on the same route as the rest of the office is a definite no no.

Payroll and accounting can also have a different route.

Remember if you have not removed the default hidden share of every XP workstation's root drive of every physical drive in each PC should not be underestimated or forgotten.

Static assignment of Private IP's is also helpful for every internal security audit. Sure once DHCP has assigned an IP to a PC it i more than likely subsequent assignment will be the same, however when it comes to internal security audits it wont stand up to any audit investigation.

Using static private addresses may take a little more time during setup, however dont give out the key to you network to anyone who asks for it unless it is totally not manageable – due to size and personally I still have security issues – no matter how big the network.

If you want to comment on this discussion, don't use the excuse you are too busy. The assignment needs only to be made once and I am not advocating suddenly changing a 300+ workstation Network.

Non emotive discussion is helpful and passionate opinions are respected, however we work in the technology industry where non-fact is not worthy of the time it takes to write it.

Please tell me how you have inviolately secured your network without DHCP and static private network assignment.

Posted: 10/30/2006 @ 20:24

[Dec 03, 2003] Macworld News Apple offers DHCP security workaround

By Peter Cohen

It's been recently noted that Mac OS X can be susceptible to a security problem involving malicious DHCP servers. The chances of the security issue affecting Mac users en masse is miniscule, but Apple recently posted details to its online Knowledgebase explaining how to circumvent potential problems.

According to a report from Carrel.org, a malicious response from a Dynamic Host Configuration Protocol (DHCP) server can grant root access on various versions of Mac OS X. DHCP is commonly used as an easy way to provide users on a network with TCP/IP addresses.

"In many cases, your Mac is protected from this kind of exploit because the malicious DHCP server has to be part of your local network, or 'subnet,'" said Apple in its recent tech note. "If your computers are the only ones on your local network and you have a broadband connection (DSL or cable service) with a Network Address Translation device -- such as an AirPort Base Station -- this exploit is not possible."

Carrel.org disputes that claim. "If you have not secured your network (especially a wireless network) against malicious devices connecting to it, you can be exploited even if you are using NAT since the attack happens behind the NAT on your local subnet," said William Carrel.

That chain of events would require someone to set up or hack a DHCP server on an exposed wireless network -- one with no password, for example, or one whose password had been compromised.

Regardless, Apple has offered steps that users concerned with this issue can take to make sure their Macs can't be exploited in this way. Steps include making sure that LDAP-based directory services are turned off, or making sure that search parameters for directory services are changed.

Recommended Links

Google matched content

Softpanorama Recommended

Top articles

Sites

Network Penetration.com/Flaws within the Dynamic Host Configuration Protocol by Ste Jones

Microsoft/Security information for DHCP

WindowsDevCenter.com -- DHCP and DNS Securityby Mike Danseglio

In this excerpt from Securing Windows Server 2003, author Mike Danseglio explores the core network services of DHCP and DNS.

Lots of elements are involved in a healthy network. Many are provided by hardware, such as the routing and switching of data. Others are provided by software and are frequently based on the network protocols in use. These services are often overlooked by security administrators and implementers. But attackers can use these services to launch, support, or continue an attack. In fact, denial-of-service attacks can be very effectively carried out by just attacking these services alone. This chapter explores two important services that exist on most networks but get very little security attention.

Microsoft has recognized the lack of security in DHCP and DNS. As a result, Windows Server 2003 has several security technologies that are not necessarily standards-based or fully compatible with other operating systems; however, depending on your computing environment and need for security, these technologies can prove beneficial.

[PDF] DHCP and the changing art of Network Security Why DHCP deserves ...

DHCP Server Security (Part 1)

Part 1 of this two-part article looks at the different types of threats faced by DHCP servers and countermeasures for mitigating these threats. www.windowsecurity.com/articles/DHCP-Security-Part1.html - 31k - Cached

DHCP Server Security (Part 2)

In Part 1 of this two-part article we looked at the different types of threats faced by DHCP servers and outlined some general countermeasures for ... www.windowsecurity.com/articles/DHCP-Security-Part2.html - 33k - Cached

DHCP and security

P-107 Security Vulnerability in Solaris 8 DHCP Administration Utilities

Reference

See also Solaris DHCP

RFC 2131 Dynamic Host Configuration Protocol

RFC 2132 DHCP Options and BOOTP Vendor Extensions



Etc

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D


Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

File Format: PDF/Adobe Acrobat - View as HTML

You can use PayPal to to buy a cup of coffee for authors of this site

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last Modified: March 12, 2019