A Capture The Flag (CTF) challenge focused on network security, where participants exploit vulnerabilities in a Flask web application running on multiple ports to retrieve hidden flags.
Kshitij Koushik Kota - https://github.com/kshitijkota
Sampriti Saha - https://github.com/Sampriti2803
- Challenge Name: Port Wine
- Category: Network Security
- Difficulty Level: Medium
- Description: Participants will utilize network scanning and exploitation techniques to identify and extract hidden flags from multiple Flask applications running on different ports.
The goal is to retrieve the flag hidden within the Flask web application by:
- Identifying open ports and running services.
- Understanding application behavior and potential vulnerabilities.
- Extracting hidden flags using various techniques, including Brainfuck decoding.
- Server Setup: Deploy the Flask application on a virtual machine (VM) or cloud server.
- Operating System: Recommended Linux (Ubuntu) environment.
- Install Dependencies:
sudo apt update && sudo apt install python3 python3-pip pip install flask
- Clone the repository:
git clone https://github.com/yourusername/port-wine-ctf.git cd port-wine-ctf
- Start the Flask applications:
python3 index.py
- The applications will run on the following ports:
- 8000
- 5001
- 8080
- 4000
- The homepage (
/
) serves anindex.html
file from the public directory (on port 8000). - The
/flag
route on different ports reveals different clues to retrieve the final flag.
Use Nmap to identify active services:
nmap [Server_IP]
For more detailed version detection:
nmap -sV [Server_IP]
Expected open ports: 8000, 5001, 8080, 4000
-
Port 5001
- Access:
curl http://[Server_IP]:5001/flag
- Returns a Google Drive link containing an encrypted
flag.pdf
.
- Access:
-
Port 8080
- Access:
curl http://[Server_IP]:8080/flag
- Returns an encoded password:
Flag4_Txt_Op3n#
- Access:
-
Port 8000 & 4000
- No useful flags are found.
- The password retrieved from port 8080 is Brainfuck-encoded.
- Decode it using a Brainfuck interpreter.
- Use the decoded password to unlock
flag.pdf
.
- The final flag should be in the format:
CTF{hidden_flag}
- Ensure the flags are not exposed in the source code.
This project is licensed under the MIT License.