Because DEP aka W^X will mark the section of memory containing the string as non-executable, so it will segfault when the instruction pointer hits that address. You can disable that security feature though with a compiler option.
Because DEP aka W^X will mark the section of memory containing the string as non-executable, so it will segfault when the instruction pointer hits that address. You can disable that security feature though with a compiler option.
DEP is a kernel-level security feature no? Since the kernel is what sets up the .text and .data sections.
As for OpenBSD and Linux without grsec/pax, one can bypass NX (whether the CPU has the NX-bit or not) by marking the region with the shellcode as executable, eg:
mprotect(shellcode & -pagesize, len, PROT_EXEC);
((void()()) shellcode)();
in an exploit this could be accomplished by ROPing
1: http://marc.info/?l=openbsd-misc&m=105056000801065
2: https://pax.grsecurity.net/docs/mprotect.txt
3: https://outflux.net/blog/archives/2009/05/14/nx-emulation-in...
DEP is just how Microsoft calls executable space protection. That's not industry standard terminology for it.