How compile exploit for Windows in Kali

History

MinGW (Minimalist GNU for Windows), formerly known as MinGW32, is an implementation of the GCC compilers for the Win32 platform, which allows migrating the capacity of this compiler in Windows environments. It is a fork of Cygwin in its version 1.3.3. Also, MinGW includes a set of Win32 API, allowing a native application development for that platform, being able to generate executables and libraries using the API of Windows.2

MinGW provides a complete set of open source programming tools, which is suitable for developing native Windows applications, which do not depend on third-party C-Runtime DLLs. It depends on some DLLs provided by Microsoft as components of the operating system; The most notable among these is MSVCRT.DLL, the Microsoft Runtime C library. Also, applications must be delivered with freely distributed DLL support provided as part of MinGW.

Practice

Installing in Kali is relatively straightforward through the package manager, although it is already installed in almost all the updated distributions by default.

The exploit is compiled. The option “-lws2_32” defines the library to use for compilation, this being due to compiling an application which will use sockets. The “-o” option specifies the name of the generated file. After compilation, if no problem has occurred a Windows PE file is obtained.

Although the goal of this exploit is to run on windows systems, it is worth mentioning that Wine is a tool that allows you to run applications designed for Windows on other operating systems such as GNU / Linux. Sometimes we must compile the exploit in .exe extension. However, it is possible to execute from our own Kali distribution.

References:

http://www.mingw.org/

https://www.winehq.org/

https://es.wikipedia.org/wiki/MinGW

Menu