An easy box from HTB, we first get access to daloradius with weak credentials using them to expose a potential user with his hashed (weak) password, I crack the password ending up getting the plaintext password and we use the password to login to the host via SSH! Easy Win! Lastly we escalate our privileges by taking advantage of Mosh (Mobile Shell). π
I start off with my nmap-scan:
We find that there are 2 ports, running a directory search won't reveal anything juicy, thus I proceed to run UDP scan with nmap:
We can see that port 161 running SNMP is open and checking the Service Info
it reveals the host's name and some other information.
You can learn more on SNMP Pentesting from here.
I use snmpbulkwalk
to enumerate for to access the data from available OIDs:
We get two interesting things from the output:
This is the second time daloradius shows up, searching it up on the browser you should find that it's a Web Management Application:
Trying to access it from port 80, brought forbidden!
Reviewing the github repository we can easily identify the login path, and there is an issue displaying the default credentials that are expected to be used to login.
Thus I proceed to access the operator's login page and use the credentials administrator:radius
:
Listing the users available we get a user named svcMosh
with a hashed password:
Using either john, hashcat, or crackstation whichever tool of your choice, you can easily crack the hash and get the plaintext password as : underwaterfriends
Using the credentials svcMosh:underwaterfriends
we are able to login via SSH:
The user is found to have sudo priviles on the binary /usr/bin/mosh-server
:
So basically mosh is a remote terminal tool, "a replacement for interactive SSH terminals". You can easily review the documentation to learn how it works and how you can connect back to the mosh-server after starting it!
We first install mosh on our host with the commands below:
We then proceed to run mosh server on port 61337 with the commands sudo mosh-server new -p 61337
and then on our host we proceed to connect back to it with the command MOSH_KEY={VALUE_OF_KEY} mosh-client 10.10.11.48 61337
, and we will be able to get an interactive shell session as root!
π¨ Got a feedback? contact me π¨
β Like this content? Consider buying me a coffee β