Giter VIP home page Giter VIP logo

example-dojo's Introduction

Example Dojo

This repositories features an example dojo.

The dojo is defined by dojo.yml.

It contains two modules, hello and world.

The module hello features challenges apple and banana.

The module world features challenges earth, mars, and venus.

Each challenge demonstrates different challenge definition capabilities, in an increasing order of feature complexity.

See each challenge's README for further information:

YAML Structure of dojo.yml

Dojo

The top-level object is the Dojo. It consists of six properties:

  • id: Required. A unique identifier for the Dojo.
  • name: Required. The display name of the Dojo.
  • description: Optional. Additional details about the Dojo. This can include formatted markdown text.
  • type: Optional. This field can take the values course, topic, or hidden. course places it in the "Courses" section. topic places the Dojo in the "Topics" section. hidden means the Dojo won't be listed (but is still accessible). If the type field is omitted or contains a value other than these three, the Dojo will appear in the "More" section.
  • password: Optional. A password that users need to join the Dojo. If omitted, the Dojo is open for anyone to join.
  • modules: Required. An array of Module objects.

Module

Each Module object within the modules array consists of the following properties:

  • id: Required. A unique identifier for the Module.
  • name: Required. The display name of the Module.
  • description: Optional. Additional details about the Module.
  • challenges: Required. An array of Challenge objects.

Challenge

Each Challenge object within the challenges array of a Module consists of the following properties:

  • id: Required. A unique identifier for the Challenge.
  • name: Required. The display name of the Challenge.
  • description: Optional. Additional details about the Challenge.

Importing Modules and Challenges

For an example of how you can import another dojo's challenges, see: pwncollege/example-import-dojo.

Automatically Updating Dojo

For instructions on how you can setup automatic dojo updates, using GitHub actions, see: pwncollege/dojo-update.

Challenge Writing Laws

The Flag

The flag is located at /flag, and is only readable by root. The challenge will execute as root. Nothing else is true.

Do not assume any structure to the flag. It may or may not have a prefix/suffix. It may or may not be 50 bytes long. These things WILL change, and if you rely on them, your challenge WILL break.

The Challenge

The challenge is setuid. This is how your challenge will execute as root.

What this really means:

  • The process will run with an effective user of root.
  • The process will run with a real user of hacker.

While an effective user of root is sufficient for opening the flag, there are some caveats. When /bin/sh (which is linked to /bin/dash) is run under this, it will immediately set the effective user to the real user (unless the -p flag is provided). This means that both the effective and real user will be hacker, and the flag will not be accessible. This affects system, which ultimately just runs /bin/sh.

The challenge can rememedy this by explicitly setting the real user to the effective user:

setreuid(geteuid(), -1)

example-dojo's People

Contributors

connornelson avatar zardus 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.