Debugging a Shellcode
4. Debugging a Shellcode
Before we actually start writing a shellcode, it is useful to introduce a small, simple piece of code that will test to see if a shellcode works. Let's suppose we have a shellcode and we want to verify that it works.
This simplest way is to use the following program:
Once we compile and run the program, if it executes as we planned, it means that the shellcode works fine.
Here is a test. If you remember in the previous module, we used a shellcode that was intended to run the Windows Calculator.
Here is the shellcode:
Before actually using the shellcode on the target system, we would like to verify that it works. To do so, we need to copy the shellcode into the previous C program.
After that, we need to compile and run the updated program to verify that it works.
It is not important that the program crashes because we can see that the Calculator appears, and it proves that the shellcode works.
This is a very simple C program that will help us test the results of our shellcode writing skills.
Last updated