Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

Do all new OSes implement the no execute bit in order to overcome vulnerabilities that could be used to execute malicious code? for example, is it implemented in Win7? Does that mean that the traditional way of stack & heap overflow exploits are no longer effective?

share|improve this question

migrated from stackoverflow.com Nov 6 '12 at 14:34

This question came from our site for professional and enthusiast programmers.

    
There are techniques to avoid this, such as return-oriented-programming (ROP). –  CodesInChaos Nov 6 '12 at 10:43
    
This is not really a programming question (unless you're an OS programmer at Microsoft or Linux or... ) On the other hand, this would be nicely on topic for the security experts over at Information Security. (Don't cross post, flag it for a moderator and ask to have it migrated). –  AviD Nov 6 '12 at 11:09
    
Whilst the mitigations are good, there are so many ways that programmers can still get things wrong. And, if all else fails, you can always go install a Sophos AV and have it disable ASLR and image integrity[pdf] for you! :) –  Polynomial Nov 14 '12 at 7:05

3 Answers 3

Windows has had Data Execution Protection since XP SP 2, but it's not always enabled by default, and it can be disabled for specific applications.

So, many stack cracking exploits will be blocked, but probably not all of them.

As for "all news OSes", YMMV. It's better to ask about specific ones.

share|improve this answer

"Traditional Way" could mean anything. I'm assuming you're referring to a buffer overflow where the return address is replaced with an attacker controlled address on the memory to execute artbitrary code. Yes, this is mitigated by the NX bit. But, no. This does not stop attackers from using other mechanisms such as Return oriented programming which uses ROP gadgets to chain instructions to effectively execute code of their choice.

I had the same question before, but I realized that stack and heap overflows will not become extinct in the near future. Windows, Linux, Solaris and other popular OSs have protection mechanisms enabled which greatly reduce these attacks. On the other hand, think of mobile platforms. Firmware, Baseband code usually written ages ago in C, are still susceptible to these attacks, and those systems may not have the protection mechanisms mentioned above.

This answer, is an excellent read to learn more about the protection mechanisms. Your specific question about NX is also covered there

share|improve this answer

One way to overcome the no execute bit is to use different overflow targets entirely. People focus too much on the shell code style overflow vulnerabilities, and ignore a large portion of the vulnerabilities that are out there. For example, you can overflow into other arrays and even strings. You don't need to corrupt the stack or heap state to exploit a buffer overflow, you just have to make the program do something it wasn't meant to do. You can overflow into:

  • Shell strings
  • SQL strings
  • Any string containing an interpreted language
  • Cryptographic keys or data that is only in plaintext in memory

None of these things requires executing any shell code in the exploited process. Many of the same techniques (e.g. spraying, sentinel sleds) apply.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.