Giter Site home page Giter Site logo

ly4k / spoolfool Goto Github PK

View Code? Open in Web Editor NEW
753.0 753.0 157.0 133 KB

Exploit for CVE-2022-21999 - Windows Print Spooler Elevation of Privilege Vulnerability (LPE)

Home Page: https://research.ifcr.dk/spoolfool-windows-print-spooler-privilege-escalation-cve-2022-22718-bf7752b68d81

License: MIT License

C++ 4.00% C 1.61% PowerShell 26.09% C# 68.31%
cve-2022-21999 cve-2022-22718

spoolfool's People

Contributors

ly4k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spoolfool's Issues

BadImageFormatException

When I try to use the Powershell script to load a vulnerable dll, the compressed file seems to be corrupted when the script uncompress it.

Tried on fresh Server 2022 Standard.

image

Windows Defender

Windows Defender with default settings appears to block this - the exe won't download, and the PS script won't run. You get "This script contains malicious content and has been blocked by your antivirus software."

So...all okay, I guess?

The PoC will not run on Windows Servers

Hi Oliver,

Update : the Poc will work well on an existing printer that the user has full control over

It seems that the provided PoC will not run at several windows Servers.
Windows server 2016 :

PS C:\Users\test\Desktop> .\SpoolFool.exe -dll AddUser.dll
[*] Using printer name: Microsoft XPS Document Writer v4
[*] Using driver directory: 4
[*] Using temporary base directory: C:\Users\test\AppData\Local\Temp\0777935b-9de1-439d-ba02-4d9e5fafcb13
[*] Trying to open existing printer: Microsoft XPS Document Writer v4
[*] Failed to open existing printer: Microsoft XPS Document Writer v4
[*] Trying to create printer: Microsoft XPS Document Writer v4
[-] Failed to create printer: Microsoft XPS Document Writer v4

Tested the same with Win2012R2

I should add that running Add-Printer -Name "test" -DriverName "Microsoft XPS Document Writer v4" -PortName "portprompt:"

Terminates with :

PS C:\Users\test\Desktop> Add-Printer -Name "test" -DriverName "Microsoft XPS Document Writer v4" -PortName "portprompt:" | fl
Add-Printer : Access was denied to the specified resource.
At line:1 char:1
+ Add-Printer -Name "test" -DriverName "Microsoft XPS Document Writer v ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (MSFT_Printer:ROOT/StandardCimv2/MSFT_Printer) [Add-Printer], CimException
    + FullyQualifiedErrorId : HRESULT 0x80070005,Add-Printer

PS C:\Users\test\Desktop>

In the writeup you do mention the lack of the desired permissions in Windows servers, but as I understand it is still should work ?
Accoring MSRC all servers are vulnerable too.

Cheers,
Bryant

Failed to create driver directory:

I'm not able to run the exploit on my lab environment.
it say "Failed to create driver directory: C:\Windows\system32\spool\DRIVERS\x64\4"
Also I don't have access to the local admin
image

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.