Bank – HackTheBox

Bank – 10.10.10.29

Target Enumeration:

OS: Linux

IP: 10.10.10.29

User: 37c97f8609f361848d8872098b0721c3

Root: d5be56adc67b488f81a4b9de30c8a68e

Ports / Services / Software Versions Running

22/tcp open ssh OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.8 (Ubuntu Linux; protocol 2.0)

53/tcp open domain

80/tcp open http Apache httpd 2.4.7 ((Ubuntu))

Vulnerability Exploited:

Plaintext password stored unencrypted within .acc file

Web application allows users to upload malicious files with the extension .htb which execute as php

Privilege Escalation:

/var/htb/bin/emergency gives you a root shell.

Exploiting the host:

Nmap

image

Add bank.htb to your /etc/hosts file

Dirsearch

image

/balance-transer is a list of accounts.

image

Download them all with wget -r.

image

There are a lot of files so list them all and search for ones with unusual sizes

image

Found a non encrypted file:

image

Login to the application and under support you will find a file upload

image

There is quite a bit of filtering on the webapp but checking the sourcecode we see that we can rename the extension to .htb and it will execute as php.

image

Upload shell.htb and execute to get a low priv shell

image

Now we have a shell

image

Download all of your tools and execute

image

After digging around the file system we see an unusal file called emergency

image

Running it gives you root

image

Now add persistence as there is nmap on this host.

Create a crypted password “nmap” and echo it into the /etc/passwd file:

image

Now login as the user nmap:nmap via ssh to get a root shell.

image