Se restore module - WinRM Priv Esc#1134
Se restore module - WinRM Priv Esc#1134rhymenaucerous wants to merge 8 commits intoPennyw0rth:mainfrom
Conversation
|
Thanks for the PR! Much appreciated that level of detail and thoroughness of the PR description, exactly how it is supposed to look like (especially the setup guide for the review). Makes reviewing a heck of a lot easier! Please also include the source code of the binary in that dir so people, including me, can look at the code themselves and if needed recompile it. Perhaps also include a comment (probably at the top of the file) in the source code linking to your repo so people can look up how to build it etc. |
|
Thanks so much! I've just now included the header and source files for the project from my repo. Please let me know if there's anything else you need or if you have any questions. |
NeffIsBack
left a comment
There was a problem hiding this comment.
A few small things, mostly formatting.
|
There was only one comment that I didn't understand but I believe I've made all other changes that you requested. Thanks so much and please let me know if there's anything else or anything that I didn't fix properly! |
No worries, looking good so far, and thank you for the PR :) Please be aware that it might take ages for me to test this PR because a lot has piled up by now. We will get there some day tho, i promise :D |
Description
I saw the issue linked above and decided to take a swing at it. This module uses WinRM to deploy a privilege escalation tool, using the
SeRestorePrivilege, to the target and run it.I made modifications to the original SeRestoreAbuse exploit by https://github.com/xct/SeRestoreAbuse because it wasn't working in the Win 11 environment that I was testing it in.
The repo was forked and a couple of changes were made (more detail at: https://github.com/rhymenaucerous/SeRestoreAbuse):
attacker:password123(Command cannot be modified for this module - would need to update C source file, rebuild VS project, and then add new exe to nxc's data repo)The only dependency is the listed tool.
Closes #793
AI Disclosure
I used Copilot with Claude Opus 4.6 to help me write the module. It wrote most of the code for this module. I reviewed all the code that was written and made edits.
It did not write any of the code for the privilege escalation tool itself.
It did not do any of the module testing.
It did not write any of this PR.
Type of change
Insert an "x" inside the brackets for relevant items (do not delete options)
Setup guide for the review
This module was tested on Windows 10 Pro (Ver 22H2 OS Build 19045.6466) and Windows 11 Pro (Ver 25H2 OS Build 26200.7840). Setup instructions:
The workstation must have a user with the following accesses/privileges:
Setup
Create a user:
net user /add testuser passwordOpen GUI for setting policy:
Assign SeRestorePrivilege to your newly created user:
Local Policies->User Rights Assignment->Restore Files and Directories->Add User or Group-> Then add your new userEnable WinRM:
Enable-PSRemotingIt's possible that your workstation will be set up on a public network which will prevent
Enable-PSRemotingfrom working. Use the following commands to make your connection private (you should not do this if you do not own the network):If the device is not pingable from the workstation running nxc, create an inbound firewall rule:
Screenshots:
Figure 1. Environment confirmation before testing exploit.
Figure 2. Confirmation that exploit works as expected.
Checklist:
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
poetry run ruff check ., use--fixto automatically fix what it can)tests/e2e_commands.txtfile if necessary (new modules or features are required to be added to the e2e tests)