format string 2¶
Writeup de Arnold-26, repris avec son autorisation. Source :
cylab-academy-writeups— challenge #448, résolu le 2026-11-24. Flags tronqués.
Catégorie : Binary Exploitation · Challenge : #448 · Résolu le : 2026-11-24
Énoncé¶
This program is not impressed by cheap parlor tricks like reading arbitrary data off the stack. To impress this program you must change data in its memory!
Download the binary here.
Download the source here.
Résolution¶
Méthode : format string write (%hn).
Binaire non-PIE avec printf(buf) et un global sus (0x404048) valant 0x21737573. Il faut le rendre égal a 0x67616c66. Le buffer est en position 14 dans les arguments du printf. On écrit 0x6761 à l'adresse 0x40404a puis 0x6c66 a 0x404048 via deux %hn en ordre croissant (%26465c%18$hn%1285c%19$hn + padding + adresses).