Skip to content

๐Ÿšฉ Real-world privilege escalation CTF challenge featuring PyYAML RCE, SUID exploitation, and authentic pentesting techniques. Educational cybersecurity training with Docker deployment and modern web interface. The festival's real website has been hacked. An attacker will soon leak student data โ€” find the breach and stop it

Notifications You must be signed in to change notification settings

Alman368/hackfest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿšฉ HackFest CTF - Real World Privilege Escalation

๐Ÿ“‹ DESCRIPTION

A Capture The Flag (CTF) challenge that simulates real-world privilege escalation in a Linux system, using authentic RCE (Remote Code Execution) and privilege escalation techniques with a complete web interface.

๐ŸŽฏ OBJECTIVE

Obtain the flag located at /root/flag.txt using:

  1. Cryptanalysis to access the vulnerable endpoint
  2. RCE exploitation through PyYAML
  3. Real privilege escalation using SUID techniques
  4. Data exfiltration to web-accessible directory

๐Ÿšจ SPOILER WARNING

โš ๏ธ IMPORTANT: This repository contains solution files that will spoil the challenge. DO NOT look at the following files until you've completed the CTF:

  • solutions/SOLUTION.md - Complete step-by-step solution
  • solutions/exploit.py - Automated exploit script

Complete the challenge first, then check the solutions!


๐Ÿณ LOCAL DEPLOYMENT

Requirements

  • Docker
  • Docker Compose
  • Linux system (or WSL2 on Windows)

Quick Start

# Clone the repository
git clone <your-repo-url>
cd hackfest-ctf

# Deploy with Docker
sudo docker-compose up -d

# Verify it's working
curl http://localhost:3000/

Access the CTF

Verification

# Check that services are running
sudo docker ps | grep hackfest

# View logs if there are issues
sudo docker-compose logs

๐ŸŽฎ HOW TO PLAY

๐ŸŒ Web Interface (Recommended for Beginners)

  1. Navigate to: http://localhost:3000
  2. Explore the different sections:
    • ๐Ÿ  Home: Information about the compromised festival
    • ๐Ÿ’ป System: Reconnaissance and enumeration
    • ๐Ÿ’ก Hints: Encrypted Caesar cipher messages
  3. Use the information gathered to perform manual exploits

๐Ÿ”Œ Direct API (Advanced Users)

  1. Use curl commands directly against http://localhost:3000
  2. Discover and exploit vulnerabilities manually
  3. Follow your own methodology and reconnaissance

๐ŸŽ“ LEARNING OBJECTIVES

This CTF teaches real-world techniques:

  • ๐Ÿ” Cryptanalysis: Caesar cipher decryption
  • ๐Ÿ’ป RCE: PyYAML unsafe load exploitation
  • โฌ†๏ธ Privilege Escalation: SUID binaries exploitation
  • ๐Ÿ“ค Data Exfiltration: File copying to web-accessible directories
  • ๐Ÿ” Post-Exploitation: System enumeration after compromise

๐Ÿ‹ ARCHITECTURE

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Frontend      โ”‚    โ”‚    Backend      โ”‚
โ”‚   (React)       โ”‚โ”€โ”€โ”€โ”€โ”‚    (Flask)      โ”‚
โ”‚   Port: 3000    โ”‚    โ”‚   Internal      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                       โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚  Nginx  โ”‚              โ”‚  Python โ”‚
    โ”‚ Proxy   โ”‚              โ”‚   App   โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”ง PROJECT STRUCTURE

hackfest-ctf/
โ”œโ”€โ”€ frontend/                  # React + Nginx Frontend
โ”œโ”€โ”€ backend/                   # Flask + Python Backend
โ”œโ”€โ”€ solutions/                 # ๐Ÿšจ SPOILER: Solution files
โ”‚   โ”œโ”€โ”€ SOLUTION.md           # Complete walkthrough
โ”‚   โ””โ”€โ”€ exploit.py            # Automated exploit
โ”œโ”€โ”€ docker-compose.yml        # Docker configuration
โ””โ”€โ”€ README.md                 # This file

๐Ÿ† FLAG FORMAT

The flag follows the format: HACKFEST{...}


โš ๏ธ SECURITY NOTES

  • EDUCATIONAL USE ONLY: Contains intentional vulnerabilities
  • ISOLATED ENVIRONMENT: Run only in Docker containers
  • REAL TECHNIQUES: All vulnerabilities are from the real world
  • NO ARTIFICIAL MECHANISMS: No fake or magical files

๐Ÿค CONTRIBUTING

Feel free to:

  • Report bugs or issues
  • Suggest improvements
  • Add new challenges
  • Improve documentation

๐Ÿ“„ LICENSE

This project is for educational purposes. Use responsibly.


๐ŸŽฏ Prove your real-world hacking skills with authentic pentesting techniques!

About

๐Ÿšฉ Real-world privilege escalation CTF challenge featuring PyYAML RCE, SUID exploitation, and authentic pentesting techniques. Educational cybersecurity training with Docker deployment and modern web interface. The festival's real website has been hacked. An attacker will soon leak student data โ€” find the breach and stop it

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published