-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LPE exploit module for the capcom driver flaw #7363
Conversation
This commit includes: * RDI binary that abuses the SMEP bypass and userland function pointer invocation that is provided by the driver. * Related metasploit module. * Associated make.build to build from command line. * Updated command line build file. This also includes the beginnings of a new set of functions that help with the management/automation of kernel-related work on Windows for local priv esc exploits.
I plan to do more testing with this on other operating systems when I have the chance. My feeling is that Windows 8 and lower will work fine (x64 only). Higher will require some more work to bypass SMAP. Until then, this module will BSOD those operating systems that support SMAP. |
"Note: The CAPCOM.SYS driver is, by default, installed in the %WINDIR%\system32 folder, so be sure to put it there yourself when testing, otherwise this module will not work (it's the only verification it does)." Are you sure? I saw no such check when reversing the driver. (I also attempted to make a PoC, but I was doing all my testing on Windows 10, which of course has SMAP. I was unsuccessful.) |
Yes I'm sure. Validated by someone who has the application installed.
|
@Wack0 It's the module that does the verification of "is Capcom.sys in system32?" before firing the exploit, not Capcom.sys itself. |
Thanks for clarifying @justinsteven. I failed to make that connection there. |
I'll add some documentation shortly. |
@Wack0 have made sure I've given you credit where possible, by the way. |
Neat addition, I'll verify and land. Thanks, @OJ!! |
Verified. I was able to escalate the privilege of my standard, non-admin Windows user:
|
Release NotesThis module achieves local privilege escalation on a Windows target by exploiting a "feature" provided by the CAPCOM.SYS driver for Windows x64. The "feature" is the driver allows for user-land functions to be executed in the context of the kernel. Currently this module has only been tested with Windows 7, but should work on earlier Windows versions or any other version that doesn't have SMAP support. |
Thank you!
|
This PR includes code that exploits the "feature" provided by the CAPCOM.SYS driver for Windows x64 that allows for user-land functions to be executed in the context of the kernel.
The exploit has only been tested on Windows 7, but should work on earlier versions, or any other version that doesn't have SMAP support.
Sample Run
Verification
use exploit/windows/local/capcom_sys_exec
exploit
NT AUTHORITY\SYSTEM
user.More information
This all began thanks to TheWack0lian's tweet. Go read it!
This tweet is also interesting for research purposes.
Note: The CAPCOM.SYS driver is, by default, installed in the
%WINDIR%\system32
folder, so be sure to put it there yourself when testing, otherwise this module will not work (it's the only verification it does).Note: Also, the driver itself has no version information in it, so we can't really rely on it as part of the
check
.Final Note: If anyone is interested in the "process" that I followed to analyse and build this, I live-streamed the process on Twitch and stashed it on Youtube as well. It can be found here: https://www.youtube.com/watch?v=pJZjWXxUEl4&list=PLYovnhafVaw9Mg-TIuiu86Zq8lQ6MBgCr First part is the analysis and dev of exploit, second is the MSF module creation. There's quite a bit of me flapping about, but I get there in the end. Hopefully some people find it useful!