Use Polygon instead of pinpoint+radius to define flag area. (retrocompatibility is ensured)
A geographic challenges plugin for CTFd that allows challenge creators to set location-based puzzles. Players must find specific geographic coordinates to solve challenges.
This plugin was originally developed for Oscar Zulu to enhance Capture The Flag competitions with geographic elements, and is now being offered to the broader CTF creator community.
- Create challenges requiring users to find specific geographic locations
- Two answer types:
- Point + tolerance radius — an answer counts if it lands within a given radius of the target
- Polygon zone — an answer counts if it lands inside a drawn area (e.g. a specific building)
- Draw and edit polygon answer zones directly on the map (Leaflet.Draw)
- Geocoding support for location search, including exact coordinate input (decimal, DMS, DMM, N/S/E/W)
- Multilingual interface (English, French, Spanish)
- Interactive map interface using Leaflet and OpenStreetMap
- Coordinate selection via map click or search
- Visual feedback showing tolerance zones
- Mobile-friendly responsive design
-
Clone this repository to your CTFd installation's
plugins/directory:cd /path/to/CTFd/plugins git clone https://github.com/yourusername/geo_challenges.git -
Restart your CTFd instance to load the plugin.
- In the CTFd admin panel, go to Challenges → Create Challenge
- Select "geo" as the challenge type
- Fill in the standard fields (name, category, description, etc.)
- Choose the answer type:
- Point + tolerance radius: click the target location on the map and set a tolerance radius (in meters)
- Polygon zone: use the polygon tool (top-left of the map) to draw the answer area, then fine-tune its vertices
- Save your challenge
You can search for a place by name or paste exact coordinates (decimal, DMS, DMM, or N/S/E/W) into the search box.
Players will:
- See an interactive map when viewing the challenge
- Place a marker by clicking on the map or using the search box
- Submit their answer
- Receive points if their point is within the tolerance radius of the target (point mode) or inside the answer zone (polygon mode)
The target location — coordinates, radius or polygon — is never sent to the player.
The plugin works out of the box with OpenStreetMap, but you can customize the following aspects:
- Tile server URLs in the JavaScript files if you prefer another map provider
- Tolerance radius default values
- UI text via the i18n.js file
The plugin supports multiple languages. Add additional translations to the i18n.js file.
- CTFd v3.0.0 or higher
- Modern browser with JavaScript enabled
This project is licensed under the GPLv3 License - see the LICENSE file for details.
- Leaflet for the map interface
- Leaflet.draw for polygon drawing and editing
- OpenStreetMap for the map tiles
- Leaflet Control Geocoder for geocoding functionality
If you find this plugin useful for your CTF events, consider supporting the developer:
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request