Giter Site home page Giter Site logo

dll_injector's Introduction

Dll Injector v1.0


Goals

The goal of this project is to use various dll injection methods to inject a dll into an existing process's memory. This project also comes with a GUI, making it simple to select the dll you wish to inject and the target process.


Injection Methods

  • Traditional dll injection

    • VirtualAllocEx()

    Allocate memory for the path to the dll we wish to inject. Make sure to flag the allocated pages as readable, executable, and writeable!

    • WriteProcessMemory()

    Write the path to the dll to the allocated memory pointed to via the base address returned from VirtualAllocEx().

    • RtlCreateUserThread()

    A wrapper for NtCreateThreadEx which creates a new thread to execute the executable memory that we just wrote. This is from an undocumented API from ntdll.dll and is more likely to work than CreateRemoteThread() due to Microsoft making continuous tweaks to their documented APIs. The magic happens when the thread calls LoadLibraryA() and we pass our path (in the victim process's memory) as an argument to make the victim process load DllMain().

    • NtCreateThreadEx()

    The lowest API level for creating a thread.

    • VirtualFreeEx()

    Free the allocated memory from the dll path we wrote

    • FreeLibrary()

    Free the dll once the thread exits so that we can inject our dll again and make it call DllMain()


Compatibility

This project was built with MSVC 2015. It is notable that the GUI was written in C# .NET. The rest of the project is written in C/C++ with Win32Api.


Build and Usage

Set the project's configuration settings to Release for GUI, MessageBox, and NativeInjector in Visual Studio.

You can load any dll into any desired process. For quick testing, you can demo the MessageBox.dll packaged in this project's Release/bin.

To use the application, just run GUI.exe from the Release directory.


Resources


Contact

If you have any questions, send an email to [email protected]


License

Licensed under an Apache V2.0 license. For more details, see LICENSE.txt

dll_injector's People

Contributors

itsbriany avatar

Stargazers

 avatar

Watchers

 avatar  avatar

dll_injector's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.