> For the complete documentation index, see [llms.txt](https://ctf.laet4x.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ctf.laet4x.com/ctf-2021/rootcon-15-ctf/exploitation-6.md).

# Exploitation 6

<figure><img src="/files/tZoFt5Bsb3lemY9zlTRV" alt=""><figcaption></figcaption></figure>

This challenge requires us to get shell access to the server.

Based on our enumeration using Ridgebot, one of the vulnerabilities of the server is **Shellshock Remote Code Execution (CVE-2014-6271).**

Description: GNU Bash through 4.3 processes trailing strings after function definitions in the values of environment variables, which allows remote attackers to execute arbitrary code via a crafted environment, as demonstrated by vectors involving the ForceCommand feature in OpenSSH sshd, the mod\_cgi and mod\_cgid modules in the Apache HTTP Server, scripts executed by unspecified DHCP clients, and other situations in which setting the environment occurs across a privilege boundary from Bash execution, aka 'ShellShock.'

I use ngrok since I don't have any VPS to create a tunnel to my kali machine.

<figure><img src="/files/TfVx5169IptBO1NcBE5q" alt=""><figcaption></figcaption></figure>

I replace the payload with one-liner reverse shell

<figure><img src="/files/GfhUJcoRqgAPOQfSiOKG" alt=""><figcaption></figcaption></figure>

I prepare my netcat listener, then I hit enter then I got a reverse shell connection

<figure><img src="/files/zHCiJye9YJ1WHVnzGiOE" alt=""><figcaption></figcaption></figure>

Inside the server, I found the image which contains the flag

<figure><img src="/files/sfjvW2u8aC25IJnv0lJv" alt=""><figcaption></figcaption></figure>

Flag: ***RC15{sXpbTeFkvtXALSTpT2Fd866774kA5kzp}***


---

# 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://ctf.laet4x.com/ctf-2021/rootcon-15-ctf/exploitation-6.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.
