Skip to main content

Python decorator for parallel exploit dispatch in Attack & Defense CTFs using the CookieFarm framework.

Project description

🍪 CookieFarm - Exploiter Manager

Language Keywords License

Python decorator for automating exploit execution in CTF Attack & Defense competitions


📦 What is it?

This package provides a @exploit_manager decorator designed to automate the parallel execution of exploits in CTF (Attack & Defense) settings, specifically for use with the CookieFarm project.

It handles:

  • Authentication with the central server
  • Retrieving team configuration
  • Automatic flag parsing from stdout

⚠️ Note: This package is not standalone. It must be used together with the CookieFarm client. The client provides the required APIs and team configurations.


📦 Installation

To install the package:

pip install cookiefarm

⚙️ How it works

The @exploit_manager decorator takes care of:

  • Calling your exploit(ip, port, name_service, flag_ids) function
  • Capturing your exploit's stdout
  • Parsing flags via regex
  • Logging the result in JSON format, including: team ID, port, service name, and the flag found

🚀 Example usage

from cookiefarm import exploit_manager
import requests

@exploit_manager
def exploit(ip, port, name_service, flag_ids):
    # Run your exploit here
    response = requests.get(f"http://{ip}:{port}/")

    # Just print the flag to stdout
    print(response.text)

# Run from the command line with arguments from CookieFarm
# python3 myexploit.py <ip_server> <password> <tick_time> <thread_number> <port> <name_service>

For execution, you have to pass the required arguments from the command line, which are provided by the CookieFarm client. The decorator will handle the rest.

python3 myexploit.py -s <server_address> -t <tick_time> -T <thread_number> -p <port> -n <name_service> -x [test mode]
Argument Description
-s or --server The address of the CookieFarm server
-t or --tick_time The time interval for the exploit execution
-T or --thread_number The number of threads to use for the exploit
-p or --port The port to target for the exploit
-n or --name_service The name of the service to exploit
-x or --test Run in test mode (does not execute the exploit)

🛠️ Requirements

  • Python ≥ 3.12
  • Working CookieFarm client installed

📝 License

Distributed under the MIT License. Feel free to use, modify, and contribute.


For any questions, suggestions, or issues, feel free to open a GitHub issue!

Created with ❤️ by ByteTheCookies (feat. @0xMatte)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cookiefarm-1.2.7.tar.gz (25.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cookiefarm-1.2.7-py3-none-any.whl (25.9 MB view details)

Uploaded Python 3

File details

Details for the file cookiefarm-1.2.7.tar.gz.

File metadata

  • Download URL: cookiefarm-1.2.7.tar.gz
  • Upload date:
  • Size: 25.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for cookiefarm-1.2.7.tar.gz
Algorithm Hash digest
SHA256 b638a622c46814f25b40acaef849d4ce0c8c9ab031dfa467881bed458eca12b6
MD5 fc018e47c18e82c1ed75117a7e6ced3f
BLAKE2b-256 10a11419bcc817ba0c0177199e7ef617f7aba95d8bd4b5a5987c2972cdca4d54

See more details on using hashes here.

File details

Details for the file cookiefarm-1.2.7-py3-none-any.whl.

File metadata

  • Download URL: cookiefarm-1.2.7-py3-none-any.whl
  • Upload date:
  • Size: 25.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for cookiefarm-1.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 883997db57d4367986a7f785321fb4c00a1a40f2fcdd18bfcb79822c72569b00
MD5 737d7e101b49846207a6dba4f5932305
BLAKE2b-256 a0b932e73bb054e45f5358dfd46c61c1a025677f9b8dc23d5cb1f13b55b3efd9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page