Address space layout randomization(ASLR)是一种参与保护缓冲区溢出问题的一个计算机安全技术。是为了防止攻击者在内存中能够可靠地对跳转到特定利用函数。ASLR包括随机排列程序的关键数据区域的位置,包括可执行的部分、堆、栈及共享库的位置。
不仅随机化栈地址,还可以随机化动态链接库(比如libc)的基地址(应对return-to-libc攻击)和mmap的地址。
配置文件:/proc/sys/kernel/randomize_va_space
The following values are supported:
- 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.