Simple CTF

Date: 06, June, 2021

Author: Dhilip Sanjay S


Click Herearrow-up-right to go to the TryHackMe room.

Enumeration

Nmap

$ nmap -sC -sV -oN nmap.out 10.10.59.145
Nmap scan report for 10.10.59.145
Host is up (0.22s latency).
Not shown: 997 filtered ports
PORT     STATE SERVICE VERSION
21/tcp   open  ftp     vsftpd 3.0.3
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
|_Can't get directory listing: TIMEOUT
| ftp-syst: 
|   STAT: 
| FTP server status:
|      Connected to ::ffff:10.17.7.91
|      Logged in as ftp
|      TYPE: ASCII
|      No session bandwidth limit
|      Session timeout in seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      At session startup, client count was 3
|      vsFTPd 3.0.3 - secure, fast, stable
|_End of status
80/tcp   open  http    Apache httpd 2.4.18 ((Ubuntu))
| http-robots.txt: 2 disallowed entries 
|_/ /openemr-5_0_1_3 
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Apache2 Ubuntu Default Page: It works
2222/tcp open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 29:42:69:14:9e:ca:d9:17:98:8c:27:72:3a:cd:a9:23 (RSA)
|   256 9b:d1:65:07:51:08:00:61:98:de:95:ed:3a:e3:81:1c (ECDSA)
|_  256 12:65:1b:61:cf:4d:e5:75:fe:f4:e8:d4:6e:10:2a:f6 (ED25519)
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

Gobuster


How many services are running under port 1000?

  • Answer: 2


What is running on the higher port?

  • Answer: ssh


What's the CVE you're using against the application?

  • Answer: CVE-2019-9053

  • Steps to Reproduce:

    • Search for Vulnerabilities in the CMS Made Simple 2.2.8 using searchsploit & then look for the CVE number in exploit db.


To what kind of vulnerability is the application vulnerable?

  • Answer: SQLi


What's the password?

  • Answer: secret

  • Steps to Reproduce:

  • Run the exploit:

  • Crack the hash:


Where can you login with the details obtained?

  • Answer: ssh

  • Steps to Reproduce:


What's the user flag?

  • Answer: G00d j0b, keep up!

  • Steps to Reproduce:


Is there any other user in the home directory? What's its name?

  • Answer:

  • Steps to Reproduce:


What can you leverage to spawn a privileged shell?

  • Answer: vim

  • Steps to Reproduce:

    • Check the files with SUID bit set:

    • Check sudo permissions:


What's the root flag?

  • Answer: W3ll d0n3. You made it!

  • Steps to Reproduce:

    • Use vim to escalate privileges:


Last updated