Coder Social home page Coder Social logo

gmh5225 / blockchain-example-ctf-challenge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zellic/example-ctf-challenge

0.0 1.0 0.0 27 KB

A self-contained example Ethereum challenge using Paradigm's CTF framework

Shell 3.84% Python 61.60% Dockerfile 2.51% Solidity 32.05%

blockchain-example-ctf-challenge's Introduction

Example Ethereum CTF challenge

This challenge uses the Ethereum ctf challenge framework developed by samczsun at Paradigm. It was originally written for CSAW CTF 2022.

We've made this challenge public so as to provide a self-contained example on how to use Paradigm's CTF framework.

See this blog post for more information. Pull requests welcome!

Installing

Prerequisites

  • Docker
  • mpwn
  • Python 3

Configuration

You'll need to set the following environment variables:

  • ETH_RPC_URL to a valid Ethereum JSON-RPC endpoint
  • PYTHONPATH to point to mpwn

You'll also need to manually install the following:

  • pip install yaml ecdsa pysha3 web3

Usage

Build everything

docker buildx build --platform linux/amd64 -t mytag .

Run a challenge

Running a challenge will open a port which users will nc to. For Ethereum/Starknet related challenges, an additional port must be supplied so that users can connect to the Ethereum/Starknet node

./run.sh mytag 31337 8545

On another terminal:

nc localhost 31337

When prompted for the ticket, they will need to solve a PoW. This ticket should NOT be shared between teams, it's a secret.

$ nc localhost 31337
1 - launch new instance
2 - kill instance
3 - get flag
action? 1
ticket please: ticket

your private blockchain has been deployed
it will automatically terminate in 30 minutes
here's some useful information

How to solve it

See solve.sh, basically just deploy Exploit.sol contract and run it. Constructor expects 100 eth and parameter is setup contract address

blockchain-example-ctf-challenge's People

Contributors

stong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.