Linkers, Loaders & Executables
Which attack does W^X (never allowing a page to be both writable and executable) make harder?
- ATrying passwords by brute force
- BFlooding a server with traffic to bring it down
- CWriting attack machine code into a data area such as the stack and jumping to it
Show answer and explanation
Answer: C. Writing attack machine code into a data area such as the stack and jumping to it
A classic attack used a buffer overflow to write machine code onto the stack and redirect the return address to run it. CPU page tables have a no-execute bit (such as the NX bit), and if the OS makes the stack, heap and .data non-executable and .text non-writable, this method no longer works. Programs that generate code at run time, such as JIT compilers, switch between write and execute permissions.
- A. Brute-forcing passwords is unrelated to memory permissions.
- B. Traffic floods are not stopped by memory permissions.
- C. Correct. Anything written there cannot be executed.