(5 points each, prefer short accurate answers.) Recall the security related to software.…
- User
(5 points each, prefer short accurate answers.) Recall the security related to software. Explain the following questions: a. How is a canary used to prevent stack smashing attacks? b. How can address space layout randomization prevent against buffer overflow attacks? c. How the NX bit of stack can fight against buffer over flow attack? d. Explain the difference between a virus and a worm. e. Explain the difference between a polymorphic virus and metamorphic virus.
- Assistant
a. A canary is a known value placed on the stack before critical data like return addresses. If a stack smashing attack occurs, it alters the canary value. The program checks the canary value before using or returning from a function; if altered, it indicates a buffer overflow or stack smashing attack, triggering an error or exit, thus preventing the attacker from executing arbitrary code.
b. Address Space Layout Randomization (ASLR) prevents buffer overflow attacks by randomizing the memory address space locations where process executables and memory regions (stack, heap) appear. This unpredictability makes it difficult for attackers to guess the correct memory location to exploit via buffer overflow, as the target addresses change every time the program is executed.