Awesome
Paradigm CTF 2021
Installing
Prerequisites
- Docker
- solc-select
- mpwn
- Python 3
Configuration
You'll need to set the following environment variables:
ETH_RPC_URL
to a valid Ethereum JSON-RPC endpointPYTHONPATH
to point to mpwn
You'll also need to manually install the following:
pip install ecdsa pysha3 web3
Usage
Build everything
./build.sh
Run a challenge
Running a challenge will open a port which users will nc
to. For Ethereum related
challenges, an additional port must be supplied so that users can connect to the Ethereum
node (which forks from mainnet state)
./run.sh babycrypto 31337
On another terminal:
nc localhost 31337
For ETH challenges:
./run.sh bank 31337 8545
When prompted for the hashcash PoW, use the default secret secret
:
$ nc localhost 31337
1 - launch new instance
2 - get flag
action? 1
hashcash -mb24 gdrfjbxs = ? secret
your private blockchain has been deployed
it will automatically terminate in 30 minutes
here's some useful information
Running the autosolver
./solve.sh
Add a new challenge
- Copy one of the existing challenge directories and rename it to your challenge's name
- Edit the
info.yaml
to add your details - Add your contracts under the
public/contracts
directory - Add any contracts which are supposed to be private, such as the source code for a rev challenge
or a challenge solution under the
contracts/private
directory - Add it to the build script with the dirname and compiler version
- (Optional) Allow it to be auto-solved:
- Do either of the following:
- Add an
private/Exploit.sol
file with aconstructor(Setup setup)
constructor that solves the challenge - Add a
private/solve.py
if it requires additional actions to be executed (e.g. babycrypto, vault)
- Add an
- Then add it to the
solve
script
- Do either of the following: