{"id":26691028,"url":"https://github.com/natounet/ctf-container-manager","last_synced_at":"2026-05-03T04:40:56.559Z","repository":{"id":284368520,"uuid":"951977421","full_name":"Natounet/CTF-Container-Manager","owner":"Natounet","description":"CTF Container Manager is a lightweight tool designed to simplify the management of Docker-based challenges for Capture The Flag (CTF) events. It allows teams to start, stop, and restart containers via a TCP connection using netcat, ensuring efficient handling while maintaining security through an authentication mechanism with a secret key.","archived":false,"fork":false,"pushed_at":"2025-03-25T14:10:16.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T15:24:35.699Z","etag":null,"topics":["capture-the-flag","challenge-hosting","container-management","ctf","ctf-platform","ctf-platforms","docker","docker-container","docker-containers"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Natounet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-20T14:38:49.000Z","updated_at":"2025-03-25T14:10:19.000Z","dependencies_parsed_at":"2025-03-25T15:24:41.679Z","dependency_job_id":null,"html_url":"https://github.com/Natounet/CTF-Container-Manager","commit_stats":null,"previous_names":["natounet/ctf-container-manager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natounet%2FCTF-Container-Manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natounet%2FCTF-Container-Manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natounet%2FCTF-Container-Manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natounet%2FCTF-Container-Manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Natounet","download_url":"https://codeload.github.com/Natounet/CTF-Container-Manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245689507,"owners_count":20656417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capture-the-flag","challenge-hosting","container-management","ctf","ctf-platform","ctf-platforms","docker","docker-container","docker-containers"],"created_at":"2025-03-26T16:16:58.317Z","updated_at":"2026-05-03T04:40:56.534Z","avatar_url":"https://github.com/Natounet.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CTF Container Manager\n\nCTF Container Manager is a lightweight tool designed to streamline the management of Docker-based challenges for Capture The Flag \\(CTF\\) events. It provides a remote interface for teams hosting challenges to start, stop, and restart containers via a TCP/TLS connection using `openssl`.\n\n---\n\n![image](https://github.com/user-attachments/assets/dc3b502d-7098-4d13-bc0c-9c322a1221c5)\n\n\n## Features\n\n- **Remote Container Management**: Start, stop, and restart Docker containers remotely.\n- **Challenge Configuration**: Define challenges in a JSON file with details such as container name, exposed port, etc.\n- **Authentication**: Access with a printable ASCII passphrase stored in `secret.key`.\n- **Status Monitoring**: View the status of all configured containers (running or stopped).\n- **Logging**: Logs all connections and container management actions for auditing purposes.\n- **TLS Encryption**: All network communications are secured using Transport Layer Security (TLS)\n\n---\n\n## Installation\n\n1. Clone the repository containing the project files:\n```bash\ngit clone https://github.com/Natounet/CTF-Container-Manager.git\ncd CTF-Container-Manager/src\n```\n\n2. Build the project:\n```bash\ngo build -o manager\n```\n\n4. Ensure Docker is installed and accessible on the host machine.\n\n---\n\n## Usage\n\n### Starting the Server\nRun the server with the following command:\n\n```bash\n./ctf-container-manager \u003csecret.key\u003e \u003cchallenges.json\u003e \u003cIP\u003e \u003cPort\u003e\n```\n\n- `\u003csecret.key\u003e`: Path to the file containing the secret key for authentication.\n- `\u003cchallenges.json\u003e`: Path to the JSON file describing challenges.\n- `\u003cIP\u003e`: The IP address on which the server will listen.\n- `\u003cPort\u003e`: The port number for client connections.\n\nExample:\n\n```bash\n./ctf-container-manager example_secret.key example_challenges.json 127.0.0.1 9000\n```\n\n![image](https://github.com/user-attachments/assets/36810a20-6d1a-41b8-91df-6b78f3ec2372)\n\n\n---\n\n### Challenge Configuration\n\nChallenges are described in a JSON file \\(`example_challenges.json`\\). Each challenge includes:\n- `fullname`: A descriptive name for the challenge.\n- `shortname`: The name of the Docker image \\(must exist locally\\).\n- `exposed_port`: The port exposed by the container for players.\n\n```javascript\n[\n{\"fullname\": \"CyberPhoenix\", \"shortname\": \"cyberphoenix\", \"exposed_port\": 9000},\n{\"fullname\": \"CryptoMaze\", \"shortname\": \"cryptomaze\", \"exposed_port\": 5678}\n]\n```\n\n---\n\n### Client Interaction\n\nClients can connect to the server using `openssl` since the server use TLS:\n\n```bash\nopenssl s_client -connect \u003cIP\u003e:\u003cPORT\u003e -quiet\n```\n![image](https://github.com/user-attachments/assets/b8b93b91-db11-4b9c-bfb5-5ada7e154a8b)\n\n\nUpon connection:\n1. Enter the secret key for authentication.\n2. Access a menu to manage containers:\n   - Start Container\n   - Stop Container\n   - Restart Container\n   - Exit\n\nThe server will display available challenges and their statuses.\n\n---\n\n## Security Considerations\n\n- Ensure `secret.key` is securely stored and accessible only by authorized users.\n- Use strong passwords in `secret.key` to prevent unauthorized access.\n\n---\n\n## Logs\n\nAll connection attempts and container management actions are logged in `server.log`. This includes:\n- Successful/failed authentication attempts.\n- Actions performed (start, stop, restart) along with timestamps and client IPs.\n\n---\n\n## Requirements\n\n- Go programming language installed (`\u003e= v1.21`).\n- Docker installed and running on the host machine.\n- Access to TCP ports for client-server communication.\n\n---\n\n---\n\n## Troubleshooting\n\n### Common Errors\n1. **Docker Not Installed**:\n   Ensure Docker is installed on your system and accessible via CLI.\n   \n2. **Missing Docker Images**:\n   Verify that all images specified in `example_challenges.json` exist locally using:\n\n3. **Duplicate Ports**:\nEnsure each challenge has a unique exposed port in `example_challenges.json`.\n\n4. **Invalid Secret Key**:\nVerify that clients are using the correct key stored in `secret.key`.\n\n---\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatounet%2Fctf-container-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatounet%2Fctf-container-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatounet%2Fctf-container-manager/lists"}