Code Monkey home page Code Monkey logo

killdefender_bof's Introduction

KillDefender_BOF

Beacon Object File implementation of pwn1sher's KillDefender.
Original POC: https://github.com/pwn1sher/KillDefender

Features:
CobaltStrike command checks to make sure beacon is Elevated or System and won't run if it isn't.
BOF enumerates username and elevates token to System if the beacon isn't already running as it. This is necessary in order to get a handle to MsMpEng.exe
Otherwise works the same as the original KillDefender
Tested on Win10, Win11, and Server 2019

Limitations:
Have not tested on x86 (mostly because I don't have ready access to a x86 win10 box)
Unlike Cerbersec's implementation (https://github.com/Cerbersec/KillDefenderBOF), no direct syscalls or other fanciness is used here.
Opens handles to Winlogon and MsMpEng.exe. Further work could duplicate already open handles to Winlogon to avoid that IOC.
No low-vis way to revert! The only way to revert these changes is to restart MsMpEng.exe and short of installing a malicious driver you are going to need to restart the machine.

Cobaltstrike command:
killdefender check - Check MsMpEng.exe's token in order to determine if KillDefender has already been run.
killdefender kill - Remove privileges and set MsMpEng.exe token to untrusted rendering Defender useless (but still running).

Check:
image

Kill:
image

Check after kill:
image

Compile using VS Native x64 prompt:

cl.exe /c /GS- /TP kdbof.cpp /FoKillDefender.x64.o

killdefender_bof's People

Contributors

octoberfest7 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.