# Exploitation 6

<figure><img src="https://382757542-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAxmqRz869b0dQQ6DjHW%2Fuploads%2F53OulLbHWjjmkoCDfOED%2Fexploitation6.png?alt=media&#x26;token=277d88ec-8942-4455-9155-73df961f5b8b" 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="https://382757542-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAxmqRz869b0dQQ6DjHW%2Fuploads%2Fl93CSfgf8udgQK4V8xsg%2Fexploitation6_1.png?alt=media&#x26;token=111be05b-089a-4dc7-acc8-f8bdb8343b37" alt=""><figcaption></figcaption></figure>

I replace the payload with one-liner reverse shell

<figure><img src="https://382757542-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAxmqRz869b0dQQ6DjHW%2Fuploads%2FLziFKHjW299tmotr6oCY%2Fexploitation6_2.png?alt=media&#x26;token=15390c46-f328-408c-88b5-284c5df56a27" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://382757542-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAxmqRz869b0dQQ6DjHW%2Fuploads%2F2pACWBHRVoJ2zmf65SjZ%2Fexploitation6_3.png?alt=media&#x26;token=1c2e7284-21c2-4311-8157-afb3d12ffb18" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://382757542-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAxmqRz869b0dQQ6DjHW%2Fuploads%2FZ8DDj9syO0EsuUsoXjMg%2Fexploitation6_4.png?alt=media&#x26;token=b3b80518-e0bd-4f19-a15e-0398eeae2185" alt=""><figcaption></figcaption></figure>

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