Skip to content

Commit 3b5e2a0

Browse files
committed
Use TARGETURI
1 parent da779b1 commit 3b5e2a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/exploits/multi/http/glassfish_deployer.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def initialize(info={})
5555
OptString.new('APP_RPORT',[ true, 'The Application interface port', '8080']),
5656
OptString.new('USERNAME', [ false, 'The username to authenticate as','admin' ]),
5757
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", '/']),
5959
OptBool.new('SSL', [ false, 'Negotiate SSL for outgoing connections', false])
6060
], self.class)
6161
end
@@ -595,7 +595,7 @@ def upload_exec(opts = {})
595595
end
596596

597597
#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")
599599
nclient = Rex::Proto::Http::Client.new(datastore['RHOST'], datastore['APP_RPORT'],
600600
{
601601
'Msf' => framework,
@@ -682,7 +682,7 @@ def try_glassfish_auth_bypass(version)
682682
end
683683

684684
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)}"
686686
end
687687

688688

@@ -740,7 +740,7 @@ def try_normal_login(version)
740740
private_type: :password
741741
))
742742

743-
@scanner.send_request({'uri'=>'/'})
743+
@scanner.send_request({'uri'=>normalize_uri(target_uri.path)})
744744
@scanner.version = version
745745
@cred_collection.each do |raw|
746746
cred = raw.to_credential

0 commit comments

Comments
 (0)