I am trying to learn to use buffer overflow attack in Ubuntu. Unfortunately, I cannot turn off Address Space Layout Randomization (ASLR) feature in this OS, which is turned on b
You can turn off ASLR for a particular process by launching with setarch
For 32 bit programs:
setarch i386 -R yourProgram
For 64 bit programs:
setarch x86_64 -R yourProgram
to echo to files with root acces using sudo you can use the following code:
echo "0" | sudo tee /proc/sys/kernel/randomize_va_space
You will need root perms before attempting it, and if I'm not mistaken, to restart once you've done it.
sudo -i
echo "0" > /proc/sys/kernel/randomize_va_space
found it myself
you have to compile this way:
gcc -fno-stack-protector -z execstack -o OUTPUT INPUT.c
gcc compile with -fno-stack-protector