Sunday
https://www.hackthebox.com/machines/sunday
🔗 Sunday
Task 0 - Deploy machine
🎯 Target IP: 10.129.229.26
Create a directory on the Desktop with the machine's name, and inside this directory, create another directory to store the materials and outputs needed to run the machine, including the scans made with nmap.
Task 1 - Reconnaissance
I prefer to start recon by pinging the target, this allows us to check connectivity and get OS info.
Sending these three ICMP packets, we see that the Time To Live (TTL) is ~64 secs. this indicates that the target should be a *nix system, while Windows systems usually have a TTL of 128 secs.
1.1 - Which is the highest open TCP port on the target machine?
It looks like there are 2 open TCP ports on the machine: 22, 55555 and 2 filtered TCP ports: 80, 8338.
55555
1.2 - What is the name of the open source software that the application on 55555 is "powered by"?
Then, we can proceed to analyze services active on open ports:
Strangely enough, port 80 is filtered, but there seems to be some relationship with the service active on port 55555, let's go and see.
Browsing it: http://sau.htb:55555/web
we see that there's up a web app to create a basket to collect and inspect HTTP requests. using request-baskets app vs 1.2.1.
We discover only this web dir: /web (Status: 200)
that unfortunely corrispond to our index page.
request-baskets
1.3 - What is the version of request-baskets running on Sau?
1.2.1
Task 2 - Find user flag
2.1 - What is the 2023 CVE ID for a Server-Side Request Forgery (SSRF) in this version of request-baskets?
Googling 'request-baskets 1.2.1' we discover that's vulnerable to a recent CVE via an SSRF attack.
CVE-2023-27163
After understanding PoC and reading details regarding usage:
we can download CVE-2023-27163.sh and execute it exploiting our vulnerability:
and now we can concatenate basket value to our URL and finally reach filtered port 80: http://sau.htb:55555/hbvoml
maltrail
2.2 - There is an unauthenticated command injection vulnerability in MailTrail v0.53. What is the relative path targeted by this exploit?
Googling 'MailTrail v0.53' we discover that's vulnerable to an unauthenticated OS Command Injection (RCE)
the username
parameter of the login page doesn't properly sanitize the input, allowing an attacker to inject OS commands.
The exploit creates a reverse shell payload encoded in Base64 to bypass potential protections like WAF, IPS or IDS and delivers it to the target URL using a curl command The payload is then executed on the target system, establishing a reverse shell connection back to the attacker's specified IP and port.
Attacker machine:
Target Machine
/login
2.3 - What user is the Mailtrack application running as on Sau?
Taking a little system enumeration (whoami and/or id) we can check user active on machine
puma
2.4 - Submit the flag located in the puma user's home directory.
Task 3 - Find root flag
3.1 - What is the full path to the application the user puma can run as root on Sau?
Very good, we can proceed with privilege escalation for obtaining the root flag.
Executing sudo -l
command we can commands that user puma can execute with sudo privileges
/usr/bin/systemctl
3.2 - What is the full version string for the instance of systemd installed on Sau?
We know that systemctl is a service associated at process systemd, we can search version digiting: systemctl --version
systemd 245 (245.4-4ubuntu3.22)
3.3 - What is the CVE ID for a local privilege escalation vulnerability that affects that particular systemd version?
Googling 'usr/bin/systemctl status trail.service', we discover this CVE:
and this useful resource:
then, only executing: sudo /usr/bin/systemctl status trail.service
and adding !sh
we can spawn a new shell, directly with root privileges.
CVE-2023-26604
3.4 - Submit the flag located in the root user's home directory.
Let's go into root folder for catching root flag!
Last updated