TBBT: Fun With Flags - Walkthrough [Vulnhub]
Here's my solution for TBBT: Fun With Flags.
The machine can be downloaded from here.
Flag-Sheldon
Scanning for all TCP ports.
$ nmap -sC -sV -p- 192.168.1.105
We find 4 ports open as well as the flag-sheldon/can also browse http://192.168.1.105:1337 to get the flag.

Flag-Howard
Since ftp is open and allows anonymous login.
$ ftp 192.168.1.105
Name: anonymous
We download a zip file located under- /pub/howard


While unzipping it ask's for password, as we do not know the password we brute-force it using fcrackzip.


We get the password as- astronaut, we unzip it and we get an image file.


We run steghide against the image file, to check if there's any hidden file/message.

Asking for password, as we do not have any we try to brute force it using stegcracker.

We successfully cracked it.

Flag-Bernadette
Scanning directories using dirb.
$ dirb http://192.168.1.105/ -r

Again we try to brute-force /music directory.

Interesting. On browsing /music/wordpress, we find that it is built on CMS- Wordpress.
We use wpscan to scan for all plugins and users.
$ wpscan --url http://192.168.1.105/music/wordpress -e ap,u

We find one plugin, metasploit does have an exploit module to exploit this plugin.
Lets start the msf console and load the exploit module.
$ sudo msfdb run
$ use exploit/unix/webapp/wp_reflexgallery_file_upload
We provide the required information and exploit it.

We upload a php reverse shell file under web root directory to get a normal shell and exit the msf console.
We browse, http://192.168.1.105/shell.php and on the other hand we start the netcat listener.

We get the reverse shell successfully.
We find database credentials in file- db_config.php, under the directory- /var/www/html/private

Lets access mysql using found credentials and get the flag.
$ mysql -ubigpharmacorp -pweareevil

Flag-Raz
Again we find a wordpress config file under the directory- /var/www/html/music/wordpress which has database credentials.

We access mysql with found credentials and get the flag.
$ mysql -ufootprintsonthemoon -pfootprintsonthemoon1337
Flag-Amy
We navigate to- /home/amy, we find a text file and an executable file.
After reading the contents of the file- notes.txt, the executable file i.e secretdiary becomes sucpicious. We run strings against the file and we see the password and the flag.

Flag-Penny
We naviagte to- /home/penny, and we find the next flag in a hidden file- .FLAG.penny.txt

Flag-Leonard
We naviagte to- /home/leonard, we find a bash file- thermostat_set_temp.sh, reading the contents of the file seems that this files runs every minute, a cron job.

We verify it by checking for cron jobs.
Interesting. Now we place the reverse shell payload into the file and on the other hand we start the netcat listener.

We wait for a minute to get the reverse shell, and we obtain the final flag.

Comments
Post a Comment