# Proving grounds Play: CyberSploit1

Proving grounds Play - Cybersploit1 CTF writeup.

### Nmap

```
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 5.9p1 Debian 5ubuntu1.10 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   1024 011bc8fe18712860846a9f303511663d (DSA)
|   2048 d95314a37f9951403f49efef7f8b35de (RSA)
|_  256 ef435bd0c0ebee3e76615c6dce15fe7e (ECDSA)
80/tcp open  http    Apache httpd 2.2.22 ((Ubuntu))
|_http-title: Hello Pentester!
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.2.22 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
```

### Web Port : 80

![img](/files/1tM831nmPY9Ehmx6WqUV)

### Fuzzing

![img](/files/xRgReINNEAnW9PwC0N43)

**SSH Password found on robots.txt file**

![img](/files/so1qWVGiq2jTtJoGaQE9)

Decode the base64 text to get the SSH password.

### Initial Foothold

Since we have the username, password and PORT 22 `SSH` is open, SSH to the attacking machine using the same.

![img](/files/a2d5RruX2LDVL2p3hrg6)

### Privilege Escalation

![img](/files/zsmPYyorBNrxJTpaSEVV)

The linux kernel in the attacking machine is vulnerable to [Linux Kernel 3.13.0 < 3.19 (Ubuntu 12.04/14.04/14.10/15.04) - 'overlayfs' Local Privilege Escalation](https://www.exploit-db.com/exploits/37292) vulnerability.

Download the exploit code to the local machine and use python http server to download the exploit to the remote machine.

Run the following to obtain root shell.

```sh
gcc exploit.c
./a.out
```

![img](/files/XpIs5OAxbC65e4NuJVuP)

**Root Obtained**

Thanks for reading!

For more updates and insights, follow me on Twitter: [@thevillagehacker](https://twitter.com/thevillagehackr).


---

# Agent Instructions: 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:

```
GET https://thevillagehacker-security.gitbook.io/ctf-writeups/writeups/2023-08-29-proving_grounds_play-cybersploit1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
