SeBackup / SeRestore
Windows SeBackup and SeRestore permissions
These permission allow full read (SeBackup) and write (SeRestore) access to any file. The first of these allows for exfiltration, while the second allows binaries to be replaced at will (combine with service- or task-based attacks!). The “Backup Operators” group has both of these permissions!
Backup useful registry hives:
Run a local SMB server with Impacket:
Then, just use copy on Windows:
Use Impacket to dump hashes from a hive and perform a pass-the-hash attack:
Link to original
SeTakeOwnership
Windows SeTakeOwnership permission
This permission allows a user to take ownership of any file or object (!!!).
The “standard” file to replace with cmd.exe with this trick is
Link to originalC:\Windows\System32\Utilman.exe
, which provides accessibility services access from lock and login screens.
SeImpersonate / SeAssignPrimaryToken
Windows SeImpersonate and SeAssignPrimaryToken permissions
These permissions allow for user impersonation. On Windows, the
Local Service
andNetwork Service
accounts already have these privileges; if IIS is installed, there will also often be anIIS AppPool/DefaultAppPool
service account with these permissions as well.However, it isn’t enough to just have access to a service running as a user with these permissions, as Windows will not allow an application to arbitrarily impersonate a user. Instead, we must have a service and then trick/force a highly privileged account to connect to it, at which point impersonation will be allowed.
One way to do this is using the RogueWinRM exploit. The idea here is that when a user logs in, the BITS service creates a connection on port 5985 to the (local) WinRM service (which is used to execute PowerShell commands) as SYSTEM. If the WinRM service isn’t running, RogueWinRM can be run instead to capture these connections (I’m guessing that the WinRM service can also be back-doored using RogueWinRM directly, but that doing so may interfere with system functionality?).
Example RogueWinRM command line:
Link to original