@@ -13,6 +13,7 @@ class Metasploit3 < Msf::Exploit::Remote
13
13
14
14
include Msf ::Exploit ::Remote ::HttpClient
15
15
include Msf ::Exploit ::EXE
16
+ include Msf ::Auxiliary ::Report
16
17
17
18
def initialize ( info = { } )
18
19
super ( update_info ( info ,
@@ -270,19 +271,28 @@ def undeploy(viewstate, session, entry)
270
271
end
271
272
end
272
273
274
+ def report_glassfish_version ( banner )
275
+ report_note (
276
+ host : rhost ,
277
+ type : 'glassfish.banner' ,
278
+ data : banner ,
279
+ update : :unique_data
280
+ )
281
+ end
282
+
273
283
#
274
284
# Return GlassFish's edition (Open Source or Commercial) and version (2.x, 3.0, 3.1, 9.x) and
275
285
# banner (ex: Sun Java System Application Server 9.x)
276
286
#
277
287
def get_version ( res )
278
- #Extract banner from response
288
+ # Extract banner from response
279
289
banner = res . headers [ 'Server' ]
280
290
281
- #Default value for edition and glassfish version
291
+ # Default value for edition and glassfish version
282
292
edition = 'Commercial'
283
293
version = 'Unknown'
284
294
285
- #Set edition (Open Source or Commercial)
295
+ # Set edition (Open Source or Commercial)
286
296
p = /(Open Source|Sun GlassFish Enterprise Server|Sun Java System Application Server)/
287
297
edition = 'Open Source' if banner =~ p
288
298
@@ -301,6 +311,8 @@ def get_version(res)
301
311
print_status ( "Unsupported version: #{ banner } " )
302
312
end
303
313
314
+ report_glassfish_version ( banner )
315
+
304
316
return edition , version , banner
305
317
end
306
318
@@ -632,6 +644,18 @@ def init_loginscanner
632
644
)
633
645
end
634
646
647
+ def report_auth_bypass ( version )
648
+ report_vuln (
649
+ name : 'GlassFish HTTP Method Authentication Bypass' ,
650
+ info : "The remote service has a vulnerable version of GlassFish (#{ version } ) that allows the " \
651
+ 'attacker to bypass authentication by sending an HTTP verb in lower-case.' ,
652
+ host : rhost ,
653
+ port : rport ,
654
+ proto : 'tcp' ,
655
+ refs : self . references
656
+ )
657
+ end
658
+
635
659
def try_glassfish_auth_bypass ( version )
636
660
sid = nil
637
661
@@ -652,6 +676,8 @@ def try_glassfish_auth_bypass(version)
652
676
end
653
677
end
654
678
679
+ report_auth_bypass ( version ) if sid
680
+
655
681
sid
656
682
end
657
683
0 commit comments