HTB - Bank

Getting Root
Tools Used:
dig, dirsearch.py, python
Nmap
Enumeration
DNS
Enumerating DNS shows potential vhost to be used in our http enumeration
HTTP
Checking out /balance-transfer/

Checking any of the files show login accounts encrypted. See example below:

Custom python script to get all the usernames and password
Running the script, shows a file that somehow was not encrypted
File Name: 68576f20e9732f1b2edc4df5b8533230.acc

Let's login to http://bank.htb/login.php using the credentials found.

Success!

Getting shell
From the Support link, we can upload files but it seems like we can only upload images. Viewing the source of the page, an interesting debug message states that using *.htb extension executes *.php files.




Privilege Escalation
Method 1 - /etc/passwd
During enumeration, the /etc/passwd showed as world writable
Generate a password using openssl: pass123
Edit the /etc/passwd file with the generated password.
Login as root
Method 2 - SUID executable

Last updated