Giter VIP home page Giter VIP logo

ctfd-fox's Introduction

CTFd-Fox

Chinese version

Updated: It's stupid to use the same address for on Blockchian challenge as people definitely will steal exploits from other transactions. This repo has been abandoned.

No more static flags for smart contract challenges!

There're some challenges store the static flag in the contract, allowing players to view it straightforward. This CTFd plugin avoids that! It requires only one more function in the contract (see example.sol).


Installation

  1. Clone the repository and place them under plugins directory.
  2. pip install web3
  3. Set your own HTTPProvider in address_flag/web3utils.py. Infura is an excellent one. Be sure you used the correct network (for most cases, Ropsten)

How to create a challenge?

  1. Create a challenge using type smart contract and no need to set flag at this stage
  2. Go to challenge, select Flags, and create a flag with type address
  3. Fill in the address of the contract

How to submit flag and how is flag judged?

Instead of typical getFlag() functions, you need to implement a leaveMsg().

example.sol

It's similar to a getFlag function: If the condition mets, the sender can leave a message to the Ethereum chain. Players need to submit the **transaction hash **for this function call. web3utils.py checks if the transaction is success and the message matches the user's email.

That is, after the user achieved some requests, the player needs to send a message contains his/her own email address and submit the transaction hash.


Own function header

There's a check in web3utils.py that the function header matches the expected one. You can edit func_header to name your own checker function.


TODO

  • Use uuid instead of email
  • Challenge specific func_header

ctfd-fox's People

Contributors

publicqi avatar

Stargazers

 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.