Skynet - THM - Braindump
January 2, 2022•366 words
There is a web server and samba running, automatically scan both using dirb and enum4linux.
The web page served is a useless search, nothing in the source code either.
There is anonymous listing enabled on the samba server, there are some directories to examine.
Dirb returned a login form exposed on a /squirrelmail directory, there is also a version number: 1.4.23
There is a known RCE for this version, but requires login credentials. Maybe we have a username (milesdyson) but password?
In the meanwhile, we can access two files only on the samba server, a message saying many passwords have been changed, so maybe it is an easy one to bruteforce? and we have some logs as well. Logs 2 and 3 are empty, but the first one seems like a wordlist, maybe we can bruteforce our squirrelmail login for milesdyson.
We bruteforce using
hydra -l milesdyson -P log1.txt 10.10.92.158 http-post-form '/squirrelmail/src/redirect.php:loginusername=USER&secretkey=PASS&jsautodetectresults=1&justlogged_in=1:Unknown user or password incorrect.'
Info steps:
- Gathered a username, milesdyson
- Squirrelmail 1.4.23
- Bruteforce credentials using log1.txt, retrieved from SMB server
- Read emails, find secret directory
- Directory bust sub directories, find vulnerable CMS
- Exploit with RFI, gain low level shell
- Exploit tar running with shell expansion as root
- Merry hacking