# Proving grounds Play: FunboxEasyEnum

Proving grounds Play - FunboxEasyEnum CTF writeup.

### Nmap

```sh
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 9c52325b8bf638c77fa1b704854954f3 (RSA)
|   256 d6135606153624ad655e7aa18ce564f4 (ECDSA)
|_  256 1ba9f35ad05183183a23ddc4a9be59f0 (ED25519)
80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))
| http-methods: 
|_  Supported Methods: GET POST OPTIONS HEAD
|_http-title: Apache2 Ubuntu Default Page: It works
|_http-server-header: Apache/2.4.29 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
```

### Web PORT: 80

```
http://192.168.177.132/mini.php
```

### Upload reverse shell

![img](/files/QEepJtxJQ5psTTny3Vvg)

Trigger reverse shell by visiting `192.168.177.132/shell.php` URL.

**Initial Foothold obtained**

![img](/files/D9emXxvv93Sv9fDIvFWX)

### User Enumeration

```
goat
harry
karla
oracle
sally
```

The above are the list of users who have home directory in the machine. The user `goat` has the password configured as same as username `goat`.

SSH to the user `goat` or switch user.

### Privilege Escalation

Enumerate executable permissions for the user goat.

```sh
t@funbox7:~$ sudo -l
Matching Defaults entries for goat on funbox7:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User goat may run the following commands on funbox7:
    (root) NOPASSWD: /usr/bin/mysql
```

Search for sudo exploit on GTFOBins for `mysql`.

![img](/files/ZlzDqLz0KYiFsFPos5k2)

![img](/files/qyLPq5IO19fckUQ7mD6C)

**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-09-15-proving_grounds_play-funboxeasyenum.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.
