GithubHelp home page GithubHelp logo

anthrax3 / cve-2021-40449 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hakivvi/cve-2021-40449

0.0 0.0 0.0 1.7 MB

My exploit for CVE-2021-40449, a Windows LPE via a UAF in win32kfull!GreResetDCInternal.

C 20.65% C++ 79.35%

cve-2021-40449's Introduction

CVE-2021-40449

My exploit for CVE-2021-40449, a Windows LPE via a UAF in win32kfull!GreResetDCInternal.

short wu

along with the UAF vulnerabilty other primitives are being used to make this exploit possible:

  • leaking the exploit's access token address in ring0 via NtQuerySystemInformation() function with the SystemHandleInformation parameter.
  • using rtlSetAllBits() as a gadget to overwrite the exploit's access_token.privileges with 0xFFs.
  • leaking rtlSetAllBits() address on ring0 by leaking the base address of ntoskrnl.exe module via EnumDeviceDrivers() function.
  • crafting the gadget's parameter BitMapHeader in such a way that will allow us to overwrite the access_token.privileges of the exploit.
  • allocating the crafted BitMapHeader via NtSetInformationThread() primitive and leaking the allocation address in the big pool via NtQuerySystemInformation() function with SystemBigPoolInformation parameter.
  • to interact with the vulnerable function we first enum printers on the system via EnumPrinters() load the driver of one of them one of them then hook the calls to the usermode callback function DrvEnablePDEV().
  • in the hook we proxy the call to the original DrvEnablePDEV() function, do the exploit stuff then return whats returned from the proxied call to the GDI.
  • triggering the UAF via a second call to ResetDC() in the hooked DrvEnablePDEV().
  • reclaim the freed PDC object via spraying a crafted object of the same size using the CreatePalette() primitive.
  • abusing the new aquired SeDebugPrivilege privilege to get NT AUTHORITY\SYSTEM via injecting shellcode to winlogon.exe process.

More information can be found on this article by Kaspersky.

PoC

PoC tested on Win10 Redstone (build 14393).

cve-2021-40449's People

Contributors

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