0

In order to make Linux machine vulnerable to overflow, I have to use these commands

sudo echo 0 > /proc/sys/kernel/randomize_va_space

and

-fno-stack-protector -z execstack -o bug bug.c

What is the purpose of using these two command before trying to overflow the machine? What security features they disable to cause buffer overflow?

3
  • How will you complete your homework assignment if you have broken your machine? Commented Oct 24, 2015 at 21:56
  • Sadly, I have run out of downvotes for today:( I'll just do the close vote. Commented Oct 24, 2015 at 22:43
  • I'm voting to close this question as off-topic because Google slave request, also about security vulnerability crap that is next-to-useless to future professional and enthusiast pogrammers. Commented Oct 24, 2015 at 22:45

1 Answer 1

5

sudo echo 0 > /proc/sys/kernel/randomize_va_space

This is Address Space Layout Randomization (ASLR). On Windows, this is opt-in per app via the /DYNAMICBASE or /HIGHENTROPYVA switches. The Linux command is disabling it for the whole OS, so be sure to turn it back on once you are done with your homework. See also Address Space Layout Randomization in Windows Vista.

-fno-stack-protector

This is Buffer overflow protection. On Windows, it is enabled by building with /GS. See also Compiler Security Checks In Depth for why this is useful.

-z execstack

This is Data Execution Protection. On Windows, this is opt-in per app via the /NXCOMPAT switch. See also /DYNAMICBASE and /NXCOMPAT

As to exactly why you have to disable these security features, that's probably the point of your homework.

On Windows there is one more security mechanism which is controlled by the /SAFESEH linker switch. See Preventing the Exploitation of Structured Exception Handler (SEH) Overwrites with SEHOP for what this is about.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.