Now we know how to successfully change a PoC, we can move to the next step and convert the exploit to a Metasploit module. Having a basic knowledge of how to write exploits is essential, since most of the PoCs found online do not come with a manual. That being said, let's move ahead with the recipe and see how we can build our own exploit modules, using an available PoC.
Before we begin with the exploit conversion, it is important to learn how stack-based buffer overflows work.
A stack-based buffer overflow occurs when more data is written to a buffer than it can hold, overrunning the buffer's boundary and overwriting adjacent memory locations.
Looking at the PoC, we can see by sending 2487
characters we can overflow the next SEH and the SEH record:
A Structured Exception Handler (SEH) is an exception handling mechanism. When a program crashes and an exception is triggered, SEH is called to try to recover operations. SEH is a linked list...