References:
ELF: Executable and Linkable Format.
PIE: Position Independent Executables.
RELRO: Relocation Read-Only.
In dynamic linked ELF:
GOT: Global Offset Table.
.got.plt
section.PLT: Procedure Linkage Table.
.plt
section..text
section.RELRO: Relocation Read-Only.
-z,relro,-z,now
: read-only for all GOT: Non-PLT part .got
and PLT part .got.plt
.-z,relro
: read-only for non-plt part .got
; the PLT part .got.plt
is still writable.Command checksec <binary>
shows the section names:
[huzaifas@babylon ~] $ checksec test
[*] '/home/huzaifas/test'
Arch: amd64-64-little
RELRO: Full RELRO
Stack: No canary found
NX: NX enabled
PIE: No PIE (0x400000)
Command to check the GOT entry address of printf
:
$ objdump -R test | grep -i printf
0000000000600fe0 R_X86_64_GLOB_DAT printf@GLIBC_2.2.5
If you could revise
the fundmental principles of
computer system design
to improve security...
... what would you change?