Friendly Reminder: If you have admin privileges but lack the necessary file permissions, you can leverage the SeBackup/SeRestore privileges directly from cmd.exe! There’s no need to elevate to LocalSystem, duplicate TrustedInstaller, or use similar methods. Simply enable the required privileges in your token, and you’re good to go.
Here are a few key points to keep in mind: 1. This approach addresses ERROR_ACCESS_DENIED, not ERROR_SHARING_VIOLATION. Note that elevation won’t resolve sharing violations anyway. 2. If you use a separate tool to enable privileges, it must modify the token of its parent process, not itself. Alternatively, the tool can adjust its own token and then launch a new instance of cmd.exe, which will inherit the updated token. 3. You can achieve the same functionality with PowerShell, but in this case, the script must manipulate its own token.
For convenience, you can use a ready-made tool that enables all available privileges, not just those related to Backup/Restore. This makes it more versatile. github.com/gtworek/PSBits…
• • •
Missing some Tweet in this thread? You can try to
force a refresh
As no one knew a working example, I had to weaponize GPO Extensions on my own 😎
The practice is a bit harder than just dropping a DLL and new key in Winlogon\GPExtensions. I believe there is a simpler way, but this one works. Unfortunately it requires AD connectivity.
A 🧵⤵
1. Create the DLL exporting PFNPROCESSGROUPPOLICY callback function, as defined at 2. "return 0" is enough for the code. 3. The real code can be put into DllMain(), of course it works. 4. Make a key in Windows NT\CurrentVersion\Winlogon\GPExtensions.learn.microsoft.com/en-us/windows/…
5. The key name has to be a GUID. Non-GUID keys are ignored. 6. Within the key, two REG_SZ values should exist:
- DllName - pointing to the DLL
- ProcessGroupPolicy - containing the exported callback name from the DLL 7. Go to Windows\CurrentVersion\Group Policy\History