I am using Ubuntu 12.04 32-bits now for some experiment I need to disable ASLR how can I do this? and after that what should I do to enable ASLR again?
According to an article How Effective is ASLR on Linux Systems?, you can configure ASLR in Linux using the
So, to disable it, run
and to enable it again, run
This won't survive a reboot, so you'll have to configure this in
should permanently disable this.
If you don't want a system-wide change, use
I find it really convenient to open a completely new shell using:
This will open a new Bash shell for you with ASLR disabled, including all child processes (programs run from this shell).
By the way, on i386,
EDIT (Apr 2016): The
The more permanent ways of disabling ASLR should be kept in a VM for obvious reasons.
to test the ability to overwrite stack frame return addresses etcetera, you'll need to compile without stack canaries