Writeups

Write ups and Walkthroughs about vulnerable machines

View on GitHub

Overpass

Back to Tryhackme Page


Enumeration

Starting machine enumeration using nmap.

nmap

There are 2 open ports i.e. SSH and HTTP. Let’s focus on HTTP first.


HTTP

Starting directory enumeration using gobuster.

gobuster

There is admin directory. Let’s check that one.

admin login

This is admin login page , it passes information to login.js file.

login.js

Login js passes information to /api/login point.

I tried sql injection , authentication bypass methods but couldn’t crack it so I check a walkthrough.

We have to create a cookie as SessionToken .

cookie

and we are logged in . There is private rsa_id key.

rsa_id


Hash cracking

Let’s crack password for private key using john.

john id_rsa

We got passphrase as “james13”.


SSH Login

Let’s log into SSH.

user flag

We got user flag.


Privilege escalation

Cron tag was mentioned on room so let’s check crontab.

crontab

So there is cron job that get buildscript.sh from overpass.thm and runs it. Let’s check host file for overpass.thm . We can update it to forward request to our machine.

updated host

Let’s setup our side now. I created /downloads/src path in my tmp folder. Also created buildscript.sh which gives reverse shell to my machine.

hosting file

I changed port to 80 so machine can request file.

Now we wait till machine requests our buildscript.sh

Setup


Root flag

We got root flag!

root flag


Sources :