Aller au contenu

format string 3

Writeup de Arnold-26, repris avec son autorisation. Source : cylab-academy-writeups — challenge #449, résolu le 2026-11-24. Flags tronqués.

Catégorie : Binary Exploitation · Challenge : #449 · Résolu le : 2026-11-24

Énoncé

This program doesn't contain a win function. How can you win?

Download the binary here.

Download the source here.

Download libc here, download the interpreter here. Run the binary with these two files present in the same directory.

Résolution

Méthode : GOT overwrite puts -> system.

Le programme leak l'adresse de setvbuf puis fait printf(buf) (format string) et puts("/bin/sh"). La libc est fournie : system = leak - 0x7a3f0 + 0x4f760. Le buffer est en position 38 des arguments. On écrit les 3 moities de system (2 octets chacune, via %hn) dans la GOT de puts (0x404000) : puts("/bin/sh") devient system("/bin/sh") et on obtient un shell.

Flag

academy{...}

Scripts