Lab_3
Lab_3
Lab setup
1. Environment: Use a Linux-based operating system.
2. Tools:
• GCC compiler.
• GDB (GNU Debugger).
• objdump for disassembling binaries.
• python for generating exploit payloads.
Introduction
1. Write a short description of the ELF (Executable and Linkable Format) file format (structure,
sections, etc.)
2. Write a Python script to process ELF files (extract useful data).
3. Write a short description of processor registers (EIP, EBP, ESP, etc.) and their usage.
Vulnerable programme
1. Copy and examine the following code. what do you think?
#include <stdio.h>
#include <string.h>
Debugging
1. Write a short tutorial on the gdb debugger
2. Start debugging the programme using gdb
3. Set a breakpoint on vuln_fun
4. Inside gdb, try to trigger segment fault exception and examine register values (eip for example)
5. Examine stack (esp register)
Exploitation
1. Use any skills you have to trigger a shell
Advanced Exploitation
1. Enable ASLR
2. Use any skills you have to trigger a shell