Windows User Privilege

Rights and Privileges in Windows

Local Admin User Rights - Elevated

PS C:\htb> whoami 

winlpe-srv01\administrator


PS C:\htb> whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                            Description                                                        State
========================================= ================================================================== ========
SeIncreaseQuotaPrivilege                  Adjust memory quotas for a process                                 Disabled
SeSecurityPrivilege                       Manage auditing and security log                                   Disabled
SeTakeOwnershipPrivilege                  Take ownership of files or other objects                           Disabled
SeLoadDriverPrivilege                     Load and unload device drivers                                     Disabled
SeSystemProfilePrivilege                  Profile system performance                                         Disabled
SeSystemtimePrivilege                     Change the system time                                             Disabled
SeProfileSingleProcessPrivilege           Profile single process                                             Disabled
SeIncreaseBasePriorityPrivilege           Increase scheduling priority                                       Disabled
SeCreatePagefilePrivilege                 Create a pagefile                                                  Disabled
SeBackupPrivilege                         Back up files and directories                                      Disabled
SeRestorePrivilege                        Restore files and directories                                      Disabled
SeShutdownPrivilege                       Shut down the system                                               Disabled
SeDebugPrivilege                          Debug programs                                                     Disabled
SeSystemEnvironmentPrivilege              Modify firmware environment values                                 Disabled
SeChangeNotifyPrivilege                   Bypass traverse checking                                           Enabled
SeRemoteShutdownPrivilege                 Force shutdown from a remote system                                Disabled
SeUndockPrivilege                         Remove computer from docking station                               Disabled
SeManageVolumePrivilege                   Perform volume maintenance tasks                                   Disabled
SeImpersonatePrivilege                    Impersonate a client after authentication                          Enabled
SeCreateGlobalPrivilege                   Create global objects                                              Enabled
SeIncreaseWorkingSetPrivilege             Increase a process working set                                     Disabled
SeTimeZonePrivilege                       Change the time zone                                               Disabled
SeCreateSymbolicLinkPrivilege             Create symbolic links                                              Disabled
SeDelegateSessionUserImpersonatePrivilege Obtain an impersonation token for another user in the same session Disabled

Standard User Rights

Backup Operators Rights

SeImpersonate and SeAssignPrimaryToken

Connecting with MSSQLClient.py

Enabling xp_cmdshell

Confirming Access

Checking Account Privileges

Escalating Privileges Using JuicyPotato

Catching SYSTEM Shell

PrintSpoofer and RoguePotato

Escalating Privileges using PrintSpoofer

Catching Reverse Shell as SYSTEM

SeDebugPrivilege

Podemos utilizar ProcDumparrow-up-right de la suite SysInternalsarrow-up-right para aprovechar este privilegio y volcar la memoria del proceso. Un buen candidato es el proceso Local Security Authority Subsystem Service (LSASS), que almacena las credenciales de usuario después de que un usuario inicie sesión en un sistema.

Esto es exitoso, y podemos cargar esto en Mimikatz usando el comando sekurlsa::minidump. Después de emitir los comandos sekurlsa::logonPasswords, obtenemos el hash NTLM de la cuenta del administrador local conectado localmente. Podemos usar esto para realizar un ataque pass-the-hash para movernos lateralmente si la misma contraseña de administrador local es usada en uno o múltiples sistemas adicionales (común en grandes organizaciones).

Remote Code Execution as SYSTEM

Identifique un proceso a nivel de SISTEMA:

Primero, necesitamos identificar un proceso que se esté ejecutando con privilegios de SISTEMA . Podemos hacerlo usando el tasklistcomando en una sesión de PowerShell con privilegios elevados.

Usando la herramienta psgetsystem:

Ahora usaremos la herramienta psgetsystem , que se puede encontra psgetsystemarrow-up-right para suplantar los privilegios de SISTEMA del proceso padre identificado y lanzar un comando como SISTEMA.

Suplantar al SISTEMA mediante el ID del proceso principal (PPID):

Por ejemplo, para iniciar cmd.exe como SYSTEM, deberá ejecutar lo siguiente:

  • -ppid → Especifica el ID del proceso principal (el ID del proceso del SISTEMA obtenido anteriormente).

  • -comando → El comando a ejecutar (en este caso, cmd.exe).

  • -cmdargs → Cualquier argumento de comando adicional (opcional).

SeTakeOwnershipPrivilege

Leveraging the Privilege

Reviewing Current User Privileges

Enabling SeTakeOwnershipPrivilege

Observa en la salida que el privilegio no está habilitado. Podemos habilitarlo usando este script que se detalla en esta entrada del blog, así como este otro que se basa en el concepto inicial.

Choosing a Target File

Checking File Ownership

Taking Ownership of the File

Confirming Ownership Changed

Modifying the File ACL

Reading the File

Last updated