Skip to main content

SolidCTF is an infrastructure solution that simplifies the build of Solidity CTF challenges.

Project description

SolidCTF

Docker CI Docker size Latest tag License: MIT

SolidCTF is an infrastructure solution that simplifies the build of Solidity Capture the Flag (CTF) challenges. It provides the ability to CTF organizers to rapidly set up a playable Solidity CTF environment, freeing them up to concentrate on designing smart contracts for puzzles.

Getting Started

Quick Demo

Use the following command to run a quick demo:

docker run -it -p 20000:20000 -e WEB3_PROVIDER_URI=https://rpc.sepolia.org chainflag/solidctf
nc 127.0.0.1 20000

Usage

  1. Clone the solidity-ctf-template using git clone git@github.com:chainflag/solidity-ctf-template.git command to create a new challenge project.
  2. Open the contract directory and code your challenge contract that contains the isSolved() to replace the example contract. For the multi-contract challenges, you can deploy them in a setup contract's constructor.
  3. Edit the challenge.yml to configure your challenge. See to the comments in this file for more details on how to configure it.
  4. Place your flag in the file flag.txt file and change the alloc address private key in the .env to your own.
  5. Run the docker-compose pull && docker-compose up -d command to start serving your challenge.

Development

Prerequisites

Before you start, make sure you have the following installed:

  • Docker
  • Python3
  • Required packages (pip install -r requirements.txt)

Run in development mode

  1. Clone the repository
git clone git@github.com:chainflag/solidctf.git
git submodule update --init --recursive
  1. Generate protobuf code and run server
make protoc
export WEB3_PROVIDER_URI="your web3 provider"
make dev
  1. Open another terminal to run client
python client.py

Format python source

To format the Python source code, you will need to install additional packages (pip install -r requirements-dev.txt) and run the following command:

make format

Acknowledgements

Many thanks to JetBrains for providing their excellent tools and an open source license to support the development of this project.

License

Distributed under the MIT License. See LICENSE for more information.

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

solidctf-1.0.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

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

solidctf-1.0.0-py2.py3-none-any.whl (9.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file solidctf-1.0.0.tar.gz.

File metadata

  • Download URL: solidctf-1.0.0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for solidctf-1.0.0.tar.gz
Algorithm Hash digest
SHA256 79736ed886f4584adc291811ba04eceff706b8fb7a84ce7dc2961a7475c7a2ef
MD5 cc46069c0391603cbc59c60ee20be95b
BLAKE2b-256 bc877322d759110d272289a9d33c499b76ea9a2e235ac8ccc828af8533932586

See more details on using hashes here.

File details

Details for the file solidctf-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: solidctf-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for solidctf-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0082a6c9c408b823b1e436b9ed75fe6e8ce3b749b9da2d6bdfe935289e4fb8c4
MD5 4c2bb6dcb6ae09c183b90cd3263fdf2c
BLAKE2b-256 15a7c2c3a82716594412571943b7b36947c0e2324fe2b1049f6da8956489762e

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