Troll2

Pavithra Santhosh
4 min readJul 17, 2021

Box url :- https://tryhackme.com/room/boxo1troll2

Hi folks,

In this article we are going to deal with an linux buffer overflow of box boxo1troll2, where we will learn a new techniques. It is a difficulty level

Without wasting time, we start the box

Deploy it

Deploying

Connect to OVPN & check connectivity

checking connectivity

Enumeration

Check for the open ports

#nmap -sS -sV -O 10.10.69.146

Port 21,22,80 is open

Enumeration

Check the web server

web

By viewing page-source, we got the Author name

Inspect-element

We will login into ftp using the author name

We get a zip file

ftp

Run gobuster

Gonuster

Check robots.txt in web

Robots.txt

By checking each dir & downloading the image, in one of the image we see the below

dont-bother directory

We got your_self dir from the dont-bother dir

cat

We got an answer.txt file

y0ur_self dir

It has the value in base64

answer.txt file

Download it to our local system by using wget command

wget

Since, all the contents are in base64, we will decode it & we will crack it using fcrackzip

Decoding & finding Password for zip file

We found the password for zip file, we will use it

unzip

We got, Let’s check it

In noob, it has private key

ssh key

We will do ssh

Here, we can see that the session is closed

ssh-login

So, we will search for any other possibilities to get the shell using ssh

While googling I got something like shell socker

search-engine

The syntax of the shell socker includes ‘( )[;:];

By using shell shocker, we got sessions

shell-shocker

We got 3 doors.

ssh-session dir

In-order to check, in which door we have to execute, we use command du -sh *

We will check the doors, which has the highest value we will execute it

While executing ./root it asks for input

executing root

We will try with some of the input.

From this we will get to know that ./root acts as echo command

We will create a pattern for it

While checking each, we got it 268 char

Creating pattern

To check JMP ESP, we will enter into “gdb” using “gdb root” command

r00t

We got JMP ESP

JMP ESP

Linux Bad character is similar for all, which is shown below

Bad char

We will execute the command using python to get root shell & flag

Controllling EIP

We got the flag

Flag
Answer
Box completion

I hope you guys learnt a new technique in this box.

Happy Learning!!!!

--

--

Pavithra Santhosh

This is Pavithra Santhosh, who is a aspiring Cyber security professional, Currently part of Red team certification programme from Hacker U.