Topology
https://app.hackthebox.com/machines/Topology

Nmap scan
Directory scan
Bruteforcing wasn't much helpful for this machine
Found a subdomain on the src code of homepage
subdomani :
latex.topology.htbURL that was given :
http://latex.topology.htb/equation.php
Subdomain scan
domains we found :
stats,devandlatex.the
statsdomain had statistics for the website,devhad a username and password for login
User shell
The intesting domain was
latex

We'll need to do
latex injectionattack.
We can't get RCE since all things were blacklisted but, there was one payload working where we can read files
Payload :
\lstinputlisting{/usr/share/texmf/web2c/texmf.cnf}Final Payload :
$\lstinputlisting{/etc/passwd}$
Ssh vdaisley
we can't get the RCE, but reading files is also important
I tried with getting ssh keys, but found out there were no keys in vdaisley's directory
After a while, i thought to get password for
dev.topology.htbOn google search I found out
.htpasswdis whereApacheserver stores the password.
GET PASSWORD FOR
devsubdomain :$\lstinputlisting{/var/www/dev/.htpasswd}$foudn the hash π
I used john to crack the hash
BOOOM DONEEEEEEE, we are now user.
Root shell
First i looked files that belongs to user <snipped>
Then i tried with finding sudo bits
Nothing was helpful so i checked
/optand found intresting folder
We dont have read access on this BUT we do have write access to it.
I ran
pspy64tool in the box
So there's a cronjob which runs with
rootprivileges, it runs all the files that ends with.pltSince we have write access to
/opt/gnuplotwe can write malicious code & wait for thecronjobto finish things for us.
AND DONE WE ARE ROOOOOOOOT
....................heapbytes's still pwning things.
Last updated