Download
# wget https://github.com/Riscure/Rhme-2016/raw/master/RHme2_prequalification_challenge
# file RHme2_prequalification_challenge
Option 1: Hopper and gdb
# strings RHme2_prequalification_challenge | grep Well
1. Load the binary using hopper.
2. Search the previous string.
3. Go to the address where is referenced (0x400855).
4. Do a decompilation:
5. Find the address where memcmp is called:
# gdb ./RHme2_prequalification_challenge
(gdb) b *0x40081d
(gdb) run
IDONTKNOW
(gdb) x/s $rbx
Option 2: LD_PRELOAD
# cat mylib.c
# gcc -fPIC -shared mylib.c -o mylib.dylib
# LD_PRELOAD=/tmp/mylib.dylib ./RHme2_prequalification_challenge
Option 3: Frida
# cat hook.py
# ./RHme2_prequalification_challenge
# python hook.py RHme2_prequalification_challenge 0x400730
Option 4: Radare
# r2 -d ./RHme2_prequalification_challenge
[0x7f6fa0ec02d0]> dcu sym.imp.memcmp
IDONTKNOW
[0x00400730]> ps @ rbx
Reference
https://www.riscure.com/challenge
No comments:
Post a Comment