Coder Social home page Coder Social logo

uac-silentclean's Introduction

SilentClean UAC bypass via binary planting

This project implements a DLL planting technique to bypass UAC Always Notify and execute code in a high integrity process.

When SilentCleanup task is launched, dismhost searches for the non existing DLL api-ms-win-core-kernel32-legacy-l1.dll under:

C:\Users\USER\Appdata\Local\Microsoft\WindowsApps

The above path exists by default in the PATH of the user.

By crafting a malicious DLL and placing it in the above directory, it will be loaded by dismhost.exe and executed with High Integrity privileges.

Implementation

The project consists of:

  • SilentClean .NET project - Launching SilentClean scheduled task with the use of the TaskScheduler library

  • DLLmain_template.c - A DLL skeleton which will spawn a process and inject the shellcode of our choice. Sample provided implements a simple CreateRemoteThread injector.

  • Cobalt strike aggressor script responsible for:

    • Generating the shellcode byte array
    • Replacing dllmain_template.c with the above shellcode
    • Compile the dll with mingw
    • Upload the dll to the required path
    • Execute .NET binary SilentClean.exe through Execute-Assembly to launch the scheduled task

Configuration

  • Feel free to replace injection method in RunMe function of dllmain_template.c. This is just a POC
  • Current spawned process to inject to is cmd.exe.
  • No shellcode encryption / compression has been baked in. As such the DLL generated will probably be flagged by an AV
  • x86_64-w64-mingw32 and headers are required to be installed on the building system
  • If CNA can not find mingw replace the variables $mingwgcc $mingwdllwrap with your path
  • Compile SilentClean .NET project and place executable in the same folder as the CNA script

Versions tested

  • Microsoft Windows 10 - 1909 18363.1110
  • Microsoft Windows 10 - 1909 18363.1082
  • Microsoft Windows 10 - 1809 17763.1457

Author

uac-silentclean's People

Contributors

leftp avatar

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.