ECSC 2019 - ¡ Hola Armigo !
13 May 2019description: Exploitez le binaire fourni pour en extraire flag.
nc challenges.ecsc-teamfrance.fr 4004
category: pwn - 394
An ARM file is attached to the description.
Using gdb-multiarch, we can retrieve the instructions:
Okay, so we can control lr
.
I tried to find "/bin/sh"
unsuccessfully but I found "/bin/cat"
instead (at 0x733fc):
All we need now is to put "/bin/cat"
in r0
before calling system
.
We need the address of system
to execute our cat
command:
I used ROPgadget to find some gadgets:
Well, the first one is perfect for our purpose (at 0x703c8).
So we will overflow, put our rop gadget address in lr
, then put address of "/bin/cat"
in r0
and jump to system
. This is our payload:
Finally, the flag is ECSC{83f0ffc67a36bb6573e8c466e22b672e678df3bf}