Giter VIP home page Giter VIP logo

environment-variable-dll-hijacking's Introduction

environment-variable-dll-hijacking

Project base on the work of @Wietze utilizing process level environment variables to have a malicious DLL loaded by a trusted process. This project aims to recreate his work and add a few ways of detecting the behavior including a powershell script and a Sigma rule.

Windows box should have Change-environment and Get-Hijackable along with the new .dll that is output from dll_generator.

Linux box (tested on Ubuntu) should have a file structure of

  • Project (or whatever you want)
    • dll_generator.sh dll_template.c input output

input folder will contain a copy of the legitimate dll you want to hijack output will have the .def, .res, and compiled .dll file to copy to the windows box

Source-Files contains either templates for compiling DLLs for hijacking use or a dummy.cpp file that is not yet working to be loaded by processes.

dll-attempts contains a .def file that creates the exports of the targeted dll that will need to be used in your malicious dll you are trying to have loaded as well as two compiled dlls that have been able to be loaded by changing a process level environment variable.

Get-Hijackable tests almost all executable in the c:\windows\system32 directory to see if they are vulnerable to this kind of DLL hijacking.

Change-Environment changes the SYSTEMROOT environment variable for one specific process to point to your own c:"something"\system32\ directory.

dll_generator takes legitimate DLLs from the input folder and uses mingw functionality to get export functions and resources to make .def and .res files. It then compiles a new DLL based on those files and a template .c file you can use for hijacking.

environment-variable-dll-hijacking's People

Contributors

masonbrott avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

zmkeh

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.