2. Address Randomization. 
After I turn on Ubuntu's address randomization, running the same attack once does not give the shell.
I get "Segmentation fault (core dumped)".
When the address randomization is turned off, the stack frame is located at the same place, and its location can be determined, hence enabling the attack.
Address randomization is used to prevent such an attack by assigning a random address for the stack frame.
Determining its location is made difficult, hence reducing chances of an attack.

Bruteforcing the attack returns a shell after many "Segmentation fault (core dumped)" errors.
When you bruteforce the attack, there is still a chance to successfully make the attack.
Although the chances are minimized with address randomization turned on, they are still there.


3. StackGuard.
You compile "stack.c" without dissabling stackguard
"gcc -o stack -z execstack stack.c"

When you run the attack, it is unsuccessful. You get the error:
"*** stack smashing detected ***: ./stack terminated
Segmentation fault (core dumped)"


4. Non-executable Stack
If you disable execution of stack, the attack is becomes unsuccessful.
You get the error:
"Segmentation fault (core dumped)"

This is because it will not execute any executable code in the stack.
This will prevent the attack from being executed making it unsuccessful.
