HTB: Sunday
| ターゲット // Sunday | |
|---|---|
| Platform | HTB |
| OS | Solaris |
| Difficulty | Easy |
| IP | 10.129.8.23 |
Enumeration#
Nmap#
▶ Nmap output
PORT STATE SERVICE VERSION
79/tcp open finger?
111/tcp open rpcbind 2-4 (RPC #100000)
515/tcp open printer
6787/tcp open http Apache httpd
22022/tcp open ssh OpenSSH 8.4 (protocol 2.0)
Solaris box with an unusual port layout – SSH on 22022 and the finger service on 79.
Finger Enumeration#
The finger service leaks valid usernames. Using Metasploit’s scanner/finger/finger_users:
| |
Confirming with manual finger queries:
| |
Both sammy and sunny are active SSH users.
Foothold#
SSH Brute Force#
With two valid usernames and SSH on a non-standard port, brute force is worth a shot:
| |
Credentials: sunny:sunday – honestly, checking {box_name} as a password would’ve saved the brute force.
Lateral Movement#
Shadow Backup → sammy#
Checking sunny’s bash history reveals breadcrumbs:
| |
Following the trail:
| |
Crack sammy’s hash:
| |
su sammy with cooldude! – we’re in.
Privilege Escalation#
sudo wget –use-askpass#
| |
wget with sudo and no password is a clean GTFOBins escalation using --use-askpass:
| |
Proof#
root@sunday
# whoami
root
Key Takeaways#
[ ノート ]
- The
fingerservice is a goldmine for user enumeration on older systems – always check it - Backup shadow files with world-readable permissions are a common CTF (and real-world) finding
- Bash history often contains hints about where to look next – check it early
sudo wgetwith--use-askpassis an underrated GTFOBins technique for privilege escalation