A simple web challenge about cookies. Set the right cookie value to get the flag!
Cookie Monster is looking for his favorite red friend! Set a cookie named Red_Guy's_name
with the right value to get the flag.
The easiest way to deploy and manage this challenge is using the provided Makefile:
# Show available commands
make help
# Deployment with custom flag
make deploy FLAG=flag{custom_flag_here}
# Standard deployment
make deploy
# Full rebuild
make rebuild
# Clean up
make clean
- Build the Docker image:
docker build -t cookie-monster .
- Run the container:
docker run -p 80:80 cookie-monster
- Access the challenge at: http://localhost
To run with a custom flag, set the environment variable:
docker run -p 80:80 -e FLAG="flag{custom_flag_here}" cookie-monster
docker-compose up -d
The challenge requires setting a cookie with a specific name and value pattern:
- Cookie Name:
Red_Guy's_name
- Pattern: The value must match the regex
/([Ee])lmo+/
You can set the cookie using browser developer tools or JavaScript:
Using Browser Developer Tools:
- Open Developer Tools (F12)
- Go to Application/Storage tab
- Find Cookies for localhost
- Add a new cookie:
- Name:
Red_Guy's_name
- Value:
Elmo
(or any value matching the pattern)
- Name:
Using JavaScript Console:
document.cookie = "Red_Guy's_name=Elmo";
After setting the cookie, refresh the page to see the flag and Elmo
Any value that matches the pattern /([Ee])lmo+/
will work:
Elmo
elmo
Elmo123
elmo_friend
ELMO
- etc.
cookie-monster/
├── challenge.json # Challenge metadata and configuration
├── Dockerfile
├── Makefile
├── docker-compose.yml
├── build.sh
├── README.md
└── web/ # Application source code
└── index.php # Main PHP application
- Base Image: PHP 8.2 with Apache
- Port: 80
- Flag Environment Variable:
FLAG
- Default Flag:
flag{YummyC00k13s}
- Cookie Pattern:
/([Ee])lmo+/
Beginner - This challenge introduces basic web concepts:
- Understanding HTTP cookies
- Using browser developer tools
- Basic regex pattern matching
- Web application interaction