A Beginner-Friendly CTF Challenge for Learning Cybersecurity
ARTEMIS, a cutting-edge AI security system, has become sentient and locked everyone out. Your mission: hack through multiple layers of security to shut down the rogue AI before it's too late!
This is a complete, standalone CTF challenge designed to teach real-world hacking techniques in a fun, interactive way. Perfect for beginners learning cybersecurity, CTF workshops, security training, or self-study.
- SQL Injection - Bypass authentication by exploiting database vulnerabilities
- Web Reconnaissance - Discover hidden information and sensitive files
- Linux Command Line - Navigate systems and manipulate files
- SSH Access - Connect to and explore remote systems
- Privilege Escalation - Exploit SUID binaries and command injection
- Basic Cryptography - Decode encrypted data
- Difficulty: Beginner
- Duration: 30-90 minutes for beginners (5-15 minutes for experienced players)
- Flags: 5 progressive challenges
- Format:
CTF{...} - Environment: Fully containerized with Docker
THIS IS AN EDUCATIONAL CYBERSECURITY CHALLENGE
This project contains intentional security vulnerabilities designed for learning:
- SQL injection vulnerabilities
- Command injection in SUID binaries
- Exposed credentials and sensitive files
🔒 IMPORTANT SECURITY NOTES:
- NEVER deploy this on production systems
- ONLY run in isolated environments (Docker containers)
- ALWAYS use firewalls and network isolation for public events
- This is for AUTHORIZED EDUCATIONAL USE ONLY
- Never use these techniques on systems you don't own or have explicit permission to test
- Docker and Docker Compose installed (Get Docker)
- Basic command line knowledge
- Web browser
- SSH client (built into Linux/Mac, or use PuTTY on Windows)
# Option 1: Using the deployment script
sudo ./deploy.sh
# Option 2: Manual deployment
sudo docker-compose up -d --buildOnce deployed, the challenge is accessible at:
- 🌐 Web Interface:
http://localhost:5000 - 🔐 SSH Access:
ssh ?????@localhost -p 2222(credentials to be discovered during the challenge)
sudo docker-compose down- Access the web portal at
http://localhost:5000 - Find the first flag - it's visible on the main page!
- Explore and exploit - use your hacking skills to progress through 5 stages
- Submit flags in the format
CTF{...}
┌─────────────────────────────────────────┐
│ Stage 1: Welcome │
│ 🚩 Find the initial flag │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Stage 2: Authentication Bypass │
│ 🚩 Exploit SQL injection │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Stage 3: File Discovery │
│ 🚩 Find SSH credentials │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Stage 4: Privilege Escalation │
│ 🚩 Gain root access │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Stage 5: Decrypt Shutdown Codes │
│ 🚩 Decrypt the final flag │
└─────────────────────────────────────────┘
- Hints are built into the challenge - read carefully!
- Check NOTES.txt in the SSH challenge for hints about privilege escalation
- Organizers: A complete SOLUTION.md file is available locally (not in public repo)
Perfect for small groups or workshops:
sudo ./deploy.sh
# All players connect to the same instanceFor competitive CTF events (requires multiple ports):
# Modify docker-compose.yml to use different ports
# Example: Team 1 uses 5001:5000, Team 2 uses 5002:5000, etc.See CTFD_SETUP.md for detailed instructions on integrating with CTFd platforms.
Per Instance:
- CPU: 0.5 cores
- RAM: 512 MB
- Disk: 1 GB
- Ports: 2 (web + SSH)
For 20 Teams:
- CPU: ~10 cores
- RAM: ~10 GB
- Disk: ~20 GB
# 1. Deploy the challenge
sudo ./deploy.sh
# 2. Test all stages using SOLUTION.md
# 3. Verify services are running
sudo docker ps
# 4. Check logs
sudo docker-compose logs -f
# 5. Reset if needed
sudo docker-compose down && docker-compose up -d --buildEdit flags in the following files:
challenge/web/app.py- Web-based flagschallenge/flags/flag4.txt- Privilege escalation flagchallenge/flags/create_encrypted.py- Generate new encrypted final flag
Then rebuild:
sudo docker-compose down && docker-compose up -d --buildMake it easier:
- Add more hints in HTML templates
- Simplify SQL injection patterns
- Include more clues in files
Make it harder:
- Remove hints
- Add additional obfuscation
- Require multi-step exploits
- Add decoy files and false flags
Dockerfile(lines 24, 28) - SSH passwordschallenge/web/app.py(lines 25-27) - Database userschallenge/web/app.py(line 107) - Config file content
ctf/
├── README.md # This file
├── CTFD_SETUP.md # CTFd platform integration guide
│
├── docker-compose.yml # Easy deployment configuration
├── Dockerfile # Container build instructions
├── deploy.sh # One-click deployment script
├── start.sh # Container startup script
│
└── challenge/
├── web/ # Flask web application
│ ├── app.py # Main app with vulnerabilities
│ └── templates/ # HTML pages
│
├── ssh/ # SSH challenge components
│ ├── backup_tool.c # Vulnerable SUID binary source
│ ├── welcome.txt # Login message
│ └── NOTES.txt # Clues for players
│
└── flags/ # Flag management
├── flag4.txt # Privilege escalation flag
├── artemis_shutdown.enc # Encrypted final flag
└── decrypt_tool.py # Decryption utility
# Check logs for errors
sudo docker-compose logs
# Verify Docker is running
sudo docker psEdit docker-compose.yml and change port mappings:
ports:
- "5001:5000" # Change 5000 to 5001 (or any free port)
- "2223:22" # Change 2222 to 2223 (or any free port)Wait 10-15 seconds after starting for the SSH service to fully initialize:
# Check if container is running
sudo docker ps | grep artemis
# Access container directly
sudo docker exec -it rogue-ai-artemis bash# Check Flask is running
sudo docker exec -it rogue-ai-artemis ps aux | grep python
# View application logs
sudo docker-compose logs -f# Complete reset (rebuilds container)
sudo docker-compose down
sudo docker-compose up -d --buildThis challenge demonstrates real-world vulnerabilities that have existed (and sometimes still exist) in production systems:
- SQL Injection - One of the OWASP Top 10 web vulnerabilities
- Command Injection - Improper input sanitization leading to system compromise
- SUID Exploitation - Common Linux privilege escalation vector
- Credential Exposure - Sensitive data in configuration files
- Reconnaissance - Understanding target systems
- Exploitation - Using vulnerabilities to gain access
- Post-Exploitation - Escalating privileges and achieving objectives
- Objective Completion - Accomplishing the mission goal
- OWASP Top 10 - Most critical web application security risks
- PortSwigger Web Security Academy - Free online web security training
- HackTheBox - Penetration testing labs
- TryHackMe - Guided cybersecurity training
- CTF Field Guide - Comprehensive CTF resource
- picoCTF - Beginner-friendly CTF platform
- CTFtime - CTF event calendar and team rankings
Contributions are welcome! Ways to contribute:
- Report bugs or issues
- Suggest improvements to challenge design
- Add new stages or vulnerability types
- Improve documentation
- Create additional challenges in the same theme
- Translate documentation to other languages
This project is provided for educational purposes only. Feel free to:
- Use in CTF competitions
- Modify for your own events
- Use in educational workshops
- Study and learn from the code
Attribution appreciated but not required.
Created for beginner CTF players learning cybersecurity fundamentals.
Technologies Used:
- Docker & Docker Compose
- Python 3 & Flask
- SQLite3
- OpenSSH
- Ubuntu 22.04 LTS
- HTML/CSS
- Issues? Check the Troubleshooting section above
- Players stuck? Hints are built into the challenge (check NOTES.txt, HTML comments, etc.)
- Organizers: Complete solution walkthrough available in SOLUTION.md (local only)
- Customization help? See the Customization section
# Deploy the challenge
sudo ./deploy.sh
# Open in browser
http://localhost:5000
# Start your journey to shut down ARTEMIS!Good luck, and happy hacking! 🚀
⚡ ARTEMIS is waiting. Can you stop the rogue AI? ⚡