Binary info
# file baby
# ./checksec.sh --file baby
# ./checksec.sh --file libc.so
Partial RELRO and Full RELRO
+ PLT --> GOT
known: GOT --> shared lib address
unknown: GOT --> PLT --> dynamic linker (lazy binding)
+ Partial RELRO (Relocation Read Only)
- read only after dynamic loader initialization: .init_array, .fini_array, .jcr .dynamic .got
- read-only: .got
- writeable: .got.plt
+ Full RELRO
- partial relro
- lazy binding disabled: imported symbols resolved at startup time.
- read-only: .got, .got.pl
Disable SIGALRM
(gdb) info signals SIGALRM
(gdb) handle SIGALRM nopass
__libc_start_main address range
(gdb) disassemble __libc_start_main
Find a __libc address
Your format > %158$llp
(gdb) x/3i 0x7ffff7a5c2b1
Find libc base address
# objdump -M intel -d libc.so | grep -A 2 'mov edi,eax'
Find cookie address
Your format > %138$llp
gdb config file
# cat .gdbinit
Exploit
# cat baby.py
# python baby.py
$ cat flag
No comments:
Post a Comment