HTB Linux Easy: Topology
Topology is an Easy rated Linux machine on HTB.
Nmap
Initial foothold
On the main page there is a link to http://latex.topology.htb/equation.php. 
Add the newly found domain and subdomain to the hosts file. 
On the equation.php page we are able to enter LaTeX formulas. 
Using ffuf we find a dev subdomain. 
Add the new subdomain to hosts file too. 
Trying to access dev.topology.htb results in a login prompt, info could be stored in a .htpasswd file? 
Use a LaTeX formula for LFI: /var/www/html/dev returned an error, however /var/www/dev works! 
Use JohnTheRipper to crack the hash: calculus20. 
Priv Esc
Linpeas reveals software that was put in the /opt directory. 
Since we have write permissions in the gnuplot directory we can easily create a file with a reverse shell payload that will be executed as root. 
After waiting for a few seconds we get a shell. 





