Rapid7 Vulnerability & Exploit Database

Nagios XI Autodiscovery Webshell Upload

Back to Search

Nagios XI Autodiscovery Webshell Upload

Disclosed
07/15/2021
Created
02/12/2022

Description

This module exploits a path traversal issue in Nagios XI before version 5.8.5 (CVE-2021-37343). The path traversal allows a remote and authenticated administrator to upload a PHP web shell and execute code as `www-data`. The module achieves this by creating an autodiscovery job with an `id` field containing a path traversal to a writable and remotely accessible directory, and `custom_ports` field containing the web shell. A cron file will be created using the chosen path and file name, and the web shell is embedded in the file. After the web shell has been written to the victim, this module will then use the web shell to establish a Meterpreter session or a reverse shell. By default, the web shell is deleted by the module, and the autodiscovery job is removed as well.

Author(s)

  • Claroty Team82
  • jbaines-r7

Platform

Linux,Unix

Architectures

cmd, x86, x64

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/http/nagios_xi_autodiscovery_webshell
msf exploit(nagios_xi_autodiscovery_webshell) > show targets
    ...targets...
msf exploit(nagios_xi_autodiscovery_webshell) > set TARGET < target-id >
msf exploit(nagios_xi_autodiscovery_webshell) > show options
    ...show and set options...
msf exploit(nagios_xi_autodiscovery_webshell) > 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

;