Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| aslr [2018/08/18 14:24] – created rpjday | aslr [2018/08/18 14:35] (current) – [Basics] rpjday | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Overview ===== | ===== Overview ===== | ||
| - | ASLR (Address Space Layout Randomization) stuff. | + | ASLR (Address Space Layout Randomization) stuff (exec shield?). |
| Links: | Links: | ||
| Line 7: | Line 7: | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | Questions: | ||
| + | |||
| + | * What about kernel ASLR (KASLR)? Look for '' | ||
| + | |||
| + | ===== Basics ===== | ||
| + | |||
| + | Binaries must be position-independent executables, | ||
| + | |||
| + | * 0 – No randomization. Everything is static. | ||
| + | * 1 – Conservative randomization. Shared libraries, stack, mmap(), VDSO and heap are randomized. | ||
| + | * 2 – Full randomization. In addition to elements listed in the previous point, memory managed through brk() is also randomized. | ||
| + | |||
| + | |||
| + | ===== Checking and changing ===== | ||
| + | |||
| + | Checking: | ||
| + | |||
| + | < | ||
| + | $ sysctl -a --pattern randomize | ||
| + | kernel.randomize_va_space = 2 | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | Changing: | ||
| + | |||
| + | < | ||
| + | # echo 2 > / | ||
| + | # sysctl -w kernel.randomize_va_space=2 | ||
| + | </ | ||