Sitemap
Brian

Brian

HTB — UnderPass

3 min readApr 8, 2025

--

HTB #3

Nmap scan

Press enter or click to view image in full size

Accessing the target via HTTP on port 80 revealed the default Apache landing page.

A subsequent UDP scan identified port 161/UDP as open, which is typically associated with the SNMP (Simple Network Management Protocol) service

Press enter or click to view image in full size

An snmpwalk enumeration of the SNMP service revealed references to ‘underpass’ being associated with a daloradius server. This suggested the presence of a web-based login interface related to the radius management service.

Press enter or click to view image in full size

To identify hidden directories or files on the web server, I conducted directory enumeration using both gobuster and ffuf with common wordlists.

Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

During directory enumeration, I discovered a potential login interface located at:

http://underpass.htb/daloradius/app/operators/login.php. This endpoint is associated with the daloradius management portal.

Press enter or click to view image in full size

We were able to login with default daloradius logins.

‘Administrator@radius’

We were able to gain access to the console as seen below

Press enter or click to view image in full size

Navigating through the console we managed to find a user and a hash.

Get Brian’s stories in your inbox

Join Medium for free to get updates from this writer.

User: ‘svcMosh’

Hash: ‘412DD4759978ACFCC81DEAB01B382403’

With the recovered hash, I initiated a password cracking attempt using Hashcat. The attack was successful, revealing the plaintext password associated with the svcMosh user account

Press enter or click to view image in full size

Now with a username and password we can try to ssh.

Press enter or click to view image in full size

We successfully gained initial access.

Press enter or click to view image in full size

Now we can try to gain root access.

Utilizing ‘sudo -l’ we manage to find the following hidden and allowed command:

Press enter or click to view image in full size

I always like running the hidden command as sudo to see if we discover any hidden messages. In this case, we did. We discover a port and some sort of key.

Press enter or click to view image in full size

After using ChatGPT I utilized the following command to generate a new key

‘sudo /usr/bin/mosh-server new -p 65000’

We are utilizing a random high port to compliment the mosh server.

Lastly, we then initiate the task with the following command and if done correctly we should gain root access:

‘MOSH_KEY=PxlXxqkamhZJT+E4qgJubg mosh-client 127.0.0.1 65000’

Press enter or click to view image in full size

Success! We gained root access.

Press enter or click to view image in full size
Press enter or click to view image in full size

--

--