Worksheet 07: Software Security II | Computer Security (Fall 2024)
Reveal ALL Solution

Worksheet 07: Software Security II

Worksheets are self-guided activities that reinforce lectures. They are not graded for accuracy, only for completion. Worksheets are due by the start of the next lecture via Blackboard link as a single PDF document. Be sure to properly label each question.

  1. In which segment of program memory stores the instructions of the program?

    Reveal Solution

  2. Explain why we refer to the stack as “growing down” and the heap as “growing up?”

    Reveal Solution

  3. In a stack frame, what is the purpose of the stack pointer and the frame pointer?

    Reveal Solution

  4. What is the instruction pointer (IP)?

    Reveal Solution

  5. When a function returns, how is the stack frame de-allocated and control returned to the call function?

    Reveal Solution

  6. Using the process you described above, explain how a buffer overflow attack could enable arbitrary code execution?

    Reveal Solution

  7. Download the following exercise exploit-me-3 as a zip file and unzip it. You should open that directory in a VSCode environment. If you already have Docker Desktop installed, it should also prompt you to open it in a container. Please do so. If you need some review, refer to problem #12 in Worksheet 2.

    In here you’ll find the source code (minus the flag) for a program that can be exploited using an stack-based buffer overflow. Do so and retrieve the flag. Also describe a way to fix this program.

    Note that the README.md file has additional instructions and hints on how to accomplish this task.

    Reveal Solution

  8. What is shell code?

    Reveal Solution

  9. What is a NOP sled and how is it used?

    Reveal Solution

  10. How does the mechanism of a heap-based vs. a stack-based overflow differ?

    Reveal Solution

  11. Explain a “heap spray” or “spray and pray” based attack?

    Reveal Solution

  12. What is a return-to-libc attack and how does it differ than using shell code?

    Reveal Solution

  13. What are “stack canaries” and how do they prevent stack-based buffer overflows?

    Reveal Solution

  14. Take a look at this OWASP report on format string attacks. How can this vulnerability be used to reveal values on the stack that the attacker?

    Reveal Solution