Rapid7 Vulnerability & Exploit Database

Nagios XI Chained Remote Code Execution

Back to Search

Nagios XI Chained Remote Code Execution

Disclosed
04/17/2018
Created
07/25/2018

Description

This module exploits a few different vulnerabilities in Nagios XI 5.2.6-5.4.12 to gain remote root access. The steps are: 1. Issue a POST request to /nagiosql/admin/settings.php which sets the database user to root. 2. SQLi on /nagiosql/admin/helpedit.php allows us to enumerate API keys. 3. The API keys are then used to add an administrative user. 4. An authenticated session is established with the newly added user 5. Command Injection on /nagiosxi/backend/index.php allows us to execute the payload with nopasswd sudo, giving us a root shell. 6. Remove the added admin user and reset the database user.

Author(s)

  • Cale Smith
  • Benny Husted
  • Jared Arave

Platform

Linux

Architectures

x86

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

;