HackTheBox - Player
Last updated
Was this helpful?
Last updated
Was this helpful?
This belongs to Trusty package that means no kind docker container involved.
Adding the subdomains to /etc/hosts file.
Found this on chat.player.htb which can be used for further exploitation.
Staging subdomain(staging.player.htb) - Exposing sensitive files
Main subdomain(player.htb) - Exposing source code for the main app
Error found on contact.php page: Database connection failed. Unknown variable user in /var/www/backup/service_config fatal error in /var/www/staging/fix.php
Now that we have secret
key for JWT, we can forge our own token. Let's create a PHP Script for this.
After changing the access
cookie, we got access to this page.
Looks like this website is vulnerable to FFmpeg HLS vulnerability. Read about this over here
.
Get the gen_xbin_avi.py
file and analyze it for better understanding. Let's run the script now.
Let's read the /var/www/backup/service_config
file with this vulnerability.
Credentials found - telegen : d-bC|jC!2uepS/w
Let's use this credentials to connect to SSH Protocol. (Both 22 and 6686)
We are in a restricted shell where we can only run few commands like clear
, exit
, help
, history
, lpath
and lsudo
There is nothing we can do now. Let's search for OpenSSH known vulnerabilities.
We can try using xauth Command Injection vulnerability. You can download the script using searchsploit -m multiple/remote/39569.py
Got credentials for peter : CQXpm\z)G5D#%S$y=
Let's try to login to Codiad running at dev.staging.htb
Change this part of the script to get Remote Code Execution, here we are using reverse shell script.
Let's run the script to get a reverse shell as www-data.
Cron job is running as root and it is executing /var/lib/playbuff/buff.php
file. Let's check the file and see if we can exploit it or not.
So there are two ways to exploit this, first is to include a malicious file and get root access and other one is de serialization vulnerability.
We have the privileges to read/write the /var/www/html/launcher/dee8dc8a47256c64630d803a4c40786g.php
So we can edit this file and place our malicious code in it and as soon as the cron job runs, this file will get executed.
This script will send us a ping request as soon as it gets executed.
Let's get a reverse shell now.
We have write privileges to /var/lib/playbuff/merge.log
and the PHP script gets the data from merge.log
file and performs a unserialize function call on that data.