A person may use this project to perform a true DLL injection attack.
Be careful using this code, and take responsibility for your actions. This code is published for learning purposes only, any unethical use of it is your responsibility only and considered a cyber crime!
As far as you use this project for learning only, as it should be, it is fine. Please, do not hurt other people using this code - it never was my intention.
This project is a POC for the DLL injection attack. In the attack, the attacker create a DLL file containing malicious code, and make another process in the OS to run this DLL by injecting the DLL path to the process memory. Therefore, the process will execute the malicious code from the DLL, and some serious damage can be caused - based on the DLL code.
In this project, there are the injector and the DLL. The injector is what the attacker uses in order to make the victim process load and execute the malicious DLL. For the injector and DLL you can find the source code with comments, description and compilation prompt using GCC.
In order to execute the attack, make sure to run the injector file from CMD. Pay attention that you need to give as argument the PID of the process you want to inject the DLL to. If no PID is given, the attack will not occur and a message will be displayed.
Also, the injector is using the relative path to the DLL, and therefore the DLL and injector must be in the same directory. If you would like to change that, do the following:
- write in the injector.c file the path to the DLL in your computer.
- compile the injector.c file using the compilation prompt added to the file.
- place either the injector or DLL in different directory, it should work.