A shellcode generator in Python
We have now attempted to write minimalist 32-bit shellcode ourselves, and readers will recognize the large number of structural offsets that need to be remembered in the process. In practice, this can make the development process difficult if there are complex task requirements. For this reason, many free community tools have been designed to automate shellcode generation – for example, Metasploit. In this section, we will try to develop a more convenient tool that can generate shellcode directly from C/C++ code.
The following example is the shellDev.py
source code from the Chapter#4
folder of the GitHub project. In order to save space, this book only extracts the highlighted code; please refer to the full source code to see all the details of the project:
Figure 4.20 – Usage of shellDev.py
We mentioned in Chapter 1, From Source to Binaries – The Journey of a C Program, that there are at least three...