Rapid7 Vulnerability & Exploit Database

VyOS restricted-shell Escape and Privilege Escalation

Back to Search

VyOS restricted-shell Escape and Privilege Escalation

Disclosed
11/05/2018
Created
09/19/2020

Description

This module exploits command injection vulnerabilities and an insecure default sudo configuration on VyOS versions 1.0.0 <= 1.1.8 to execute arbitrary system commands as root. VyOS features a `restricted-shell` system shell intended for use by low privilege users with operator privileges. This module exploits a vulnerability in the `telnet` command to break out of the restricted shell, then uses sudo to exploit a command injection vulnerability in `/opt/vyatta/bin/sudo-users/vyatta-show-lldp.pl` to execute commands with root privileges. This module has been tested successfully on VyOS 1.1.8 amd64 and VyOS 1.0.0 i386.

Author(s)

  • Rich Mirch
  • bcoles <bcoles@gmail.com>

Platform

Unix

Architectures

cmd

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/linux/ssh/vyos_restricted_shell_privesc
msf exploit(vyos_restricted_shell_privesc) > show targets
    ...targets...
msf exploit(vyos_restricted_shell_privesc) > set TARGET < target-id >
msf exploit(vyos_restricted_shell_privesc) > show options
    ...show and set options...
msf exploit(vyos_restricted_shell_privesc) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;