Hanto Dojo

Python Jails

A collection of challenges about breaking out of Python jails.

12 challenges

Challenges

CHALLENGE 01

Evaluating Is Fun!

— solves

Welcome to the Python jails! Can you guess the sum of two numbers without knowing the numbers?

Unfortunately, I never learned how to convert strings to integers in Python, so I'll be using eval instead!

A quick reminder: setuid Python scripts in the /challenge folder should be run as /challenge/run.py, not as python /challenge/run.py.

CHALLENGE 02

Variables Are Fun!

— solves

This program does not print out the flag when you win.

It will only tell you how long the flag is, just to taunt you.

I am confident that there is no way for the program to leak the flag.

CHALLENGE 03

Functions Are Fun!

— solves

I thought of this idea of putting win and lose in separate functions.

CHALLENGE 04

Printing Is Fun!

— solves

This program doesn't print out your answer anymore.

How will you see the fruits of your efforts this time?

CHALLENGE 05

Opening Is Fun!

— solves

There is no flag variable this time.

I can't think of a way a user could read the flag themselves.

CHALLENGE 06

Globals Are Fun!

— solves

Today I learned: Some Python functions are too overpowered!

Can't open a file without open, right?

CHALLENGE 07

Modules Are Fun!

— solves

Underscores are my worst enemy!

I found a way to get the length of the flag without opening it.

Surely os is safe?

CHALLENGE 08

Importing Is Fun!

— solves

Some modules are just too dangerous to import.

Surely you can't just import a module yourself?

CHALLENGE 09

Attributes Are Fun!

— solves

Everything in Python is too dangerous.

I'm deleting everything except the things I need.

No, I still refuse to learn how to convert strings to integers myself.

There is no way a nefarious user can access anything after I delete it, right?

CHALLENGE 10

Nesting Is Fun!

— solves

No floats allowed in this treehouse.

CHALLENGE 11

Impossibler

— solves

This level is even more impossible than impossible.

CHALLENGE 12

Yet Another Minimal Loop

— solves

This program evaluates short YAML one-liner files into Python objects.