Thursday, January 7, 2016

Turn off ASLR

http://askubuntu.com/questions/318315/how-can-i-temporarily-disable-aslr-address-space-layout-randomization

According to an article How Effective is ASLR on Linux Systems?, you can configure ASLR in Linux using the /proc/sys/kernel/randomize_va_space interface.
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.
So, to disable it, run
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
and to enable it again, run
echo 2 | sudo tee /proc/sys/kernel/randomize_va_space
This won't survive a reboot, so you'll have to configure this in sysctl. Add a file /etc/sysctl.d/01-disable-aslr.conf containing:
kernel.randomize_va_space = 0
should permanently disable this.

http://www.2cto.com/os/201212/178306.html

If you use VIM or VI to change the value, it will have following error message:

 "/proc/sys/kernel/randomize_va_space" E667: Fsync failed
 Press ENTER or type command to continue

 Why:U cannot edit the  /proc files with  vi  . if u want 
 to change its value u can  echo to that file  like 
 echo "20000000" >   /proc/sys/kernel
======================================
 # echo 0 >/proc/sys/kernel/randomize_va_space 
 # more /proc/sys/kernel/randomize_va_space 
 0
=====================================

1 comment:

lolpoop said...

Dude, thank you! Nothing I tried was working! Now I have a few aliases for the different levels of ASLR in my .bashrc file.