Compiling the Exploit¶
Sometimes you encounter target running older or vulnerable version of kernel and quick google will give you require exploit code to run and gain root privileges , but in most case , this exploit will come as piece of c code and not as binary so you can't run it without compiling it first
If the remote host has compilation tools installed like GCC, it is best to compile the exploit on the target host. This can save you trouble with missing packages, dependencies and system specific variables (such as the architecture). If the target host does not have the right tools available to compile exploits, then you will have to compile the exploit locally on your attack box and then transfer the compiled exploit to the target.
-
For 32 bit environment
i686-w64-mingw32-gcc -o main32.exe main.c
-
For 64 bit environment
x86_64-w64-mingw32-gcc -o main64.exe main.c
i686-w64-mingw32-gcc 42341.c -o syncbreeze_exploit.exe -lws2_32