Proyect which consists of creating a C program that causes a simple buffer overflow in a Windows XP 32-bit environment. The buffer owerflow will be perform by strcpy function.
A Windows XP virtual machine was used to perform the project. Another possible options is using a Docker container.
You can easily create a virtual machine with vagrant following the following steps:
- Install VirtualBox in your machine
- Install vagrant
- Run WindowsXP_sp3_visual_studio.sh
- Open virtual machine with virtualbox
Once it is already installed, virtualbox is used to boot up and open it.
VirtualBox lets having shared clipboards and to drag files between host and guest machines. You can enable it in the top menú:
- Shared Clipboard: Devices > Shared Clipboard > Bidirectional
- Drag and Drop: Devices > Drag and Drop > Bidirectional
- Compile tsunami.c and payload.c
- Send them to guest machine to the same folder (this can be made by dragging them with virtualbox function)
- Run payload:
./payload
- shellcode_calc.c and shellcode_cmd.c: Are C files that execute some instructions in assembly language that open the calculator and the terminal respectively. They were used to obtain those instructions in hexadecimal with the debugger, which were later added to payload.c. Both files can be compiled and run with Microsoft Visual C++ which was already installed in Windows XP virtual machine.