SpeedHacking on Youtube >>

CREDS >>

TryHackMe – https://tryhackme.com/p/TheSysRat

HackTheBox – https://app.hackthebox.com/profile/1298347


TryHackMe >>

https://tryhackme.com/r/room/pyrat


Recon >>>

nmap >>

Port 8080/TCP >>

There we can found Apache Tomcat/8.5.93 there are some vulnerabilities nothing interesting yet >>

https://security.snyk.io/package/maven/org.apache.tomcat:tomcat/8.5.93

Port 8888/TCP >>

On this port is running Aria2 WebUI web downloader >>

After research we can found this interesting article about LFI >>

https://gist.github.com/JafarAkhondali/528fe6c548b78f454911fb866b23f66e

So we can try >>

Great, so we can look around , I create easy script to automation this work >>

https://github.com/TheSysRat/BackTrack–THM

Usage >>

After our script is done we can found tomcat-users.xml file and there are some creads >>

We can try to login, but not useful and there is other problem and that is access denied >>

But we can try other thing, maybe we can upload our own config to server via Aria2 WebUI, let’s try >>

Prepare config file >>

And save as tomcat-users.xml , run python http.server and try to upload >>

We need some tweaks like allow-overwrite (Advance settings) file change dir to save to /opt/tomcat/conf >>

And try to upload >>

And success now we can try to login as new user >>

And we are in !! Now we can create reverse shell and try to get it…. we can use this reverse shell describe in hacktricks >>

https://book.hacktricks.xyz/network-services-pentesting/pentesting-web/tomcat

Prepare reverse shell >>

Prepare listener in msfconsole >>

Upload our reverse shell and and deploy >>

NOTE: You must click on /revshell path link to execute ;-).

If everything we can get shell as tomcat user >>


Path to user wilbur


We can look around and found this in sudo -l >>

Nice so we can try to use path traversal to use our own .yml include exploit and get the reverse shell as user wilbur, let’s try >>

Prepare malicious yml file >>

And upload to server to /tmp/test.yml file we can use for example python http.server and curl >

Prepare nc listener >>

And now we can try to run sudo command as user wilbur >>

Great now we are user wilbur !!

We can go to home directory and there we can found this creads >>

So we can try to log in via SSH >>

And it works !!


Path to user orville


In home directory user wilbur we can found file with message from orville >>

After research we can found that web server is running on port 80 but as localhost >>

So we can try to forward it and try to get user orville shell, lets’ try with chisel >>

Prepare server to connect (Kali machine) >

And connect from victom machine >

Now we can get Orville image gallery >>

So we can try to upload php rev shell and try to get orville shell. But we need use some magic to bypass upload filter >>

Prepare php reverse shell, we can use PHP PentestMonkey available on revshells.com >

And save it as %252e%252e%252fshell.png, what meant double decode of this >>

It will upload our php script to root directory of HTTP server >>

And success, now we can run listener on port what we prepare reverse shell and try to connect >>


Path to ROOT


In home directory of user orville we can found web_snapshot.zip that we should find before, when we run pspy64 >>

So root is switch to user orville over su, so we can try to capture SIGINT in Python >

https://www.linuxjournal.com/article/3946

https://stackoverflow.com/questions/1112343/how-do-i-capture-sigint-in-python

Prepare Python script for catch the flag >>

Now we upload to our server in /dev/shm/root.py >

And add to run after login as user orville add this command to .bashrc >

echo “python3 /dev/shm/root.py” >> /home/orville/.bashrc

After while, we can find all file in root dir in /tmp/ folder, grab the flag and finally done!


And we are DONE!

BackTrack machine was PWNed !!

Happy hacking!!

Leave a Reply

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