ftc 5202 (NOT SURE IF ILL INCLUDE THE SOURCE CODE FOR THE API)
This API is designed for a Capture The Flag (CTF) challenge, providing a set of functionalities to interact with user data stored in CSV format. It supports operations to retrieve specific files or data based on given parameters.
- File Retrieval: GET requests allow for the retrieval of specific files from the server, given a valid file name.
- Data Querying: POST requests enable querying specific data from a CSV file, based on a given region ID.
- Python 3.x
- Flask
- Clone the repository to your local machine.
- Install the required dependencies by running
pip install flask
. - Start the server with
python api.py
. The API will be available athttp://localhost:8000
.
Retrieves files from the server.
Parameters:
debugPin
(optional): A debug pin for testing purposes.fileName
: The name of the file to retrieve. Use*
to list all available files.
Responses:
200 OK
: File or file list successfully retrieved.400 Bad Request
: Required parameters are missing.403 Forbidden
: Invalid request due to incorrectdebugPin
.404 Not Found
: The specified file was not found.
Queries data from a CSV file based on the provided region ID.
Body:
RegionID
: The ID of the region to query.
Responses:
200 OK
: Data successfully retrieved.404 Not Found
: The specified region ID was not found.
In case of encountering errors, the API provides descriptive error messages to assist in debugging. For testing and debugging purposes, a default debugPin
is provided: 123-456-789
. This pin should be used cautiously and only in a secure testing environment to prevent unintended data exposure.
Ensure that the API is not exposed to the public internet without proper security measures in place, especially when using the debugPin
feature.
For further details on request formats and additional parameters, refer to the API source-code.
For support or to report issues, please file an issue on the GitHub repository associated with this challenge.