π΄Domain Presistance
Kerberos
It is a authentication method for Windows Active Directory How it works :-
User sends timestamp to KDC/DC and that timestamp is encrypted with user passwords hash (NTLM hash) to request a TGT
TGT (Ticket Granting Ticket) is use to get us another TGS so that we can access any service
Then KDC/DC decrypts it as it already has password of every user, and after decrypting it sends the TGT which is encrypted with NTLM hash of krbtgt user
krbtgt user is the special user account created by default. Its purpose is to act as a KDC (Key Distribution Centre) service account for domain controllers
Then user sends the TGT encrypted with krbtgt hash to request a TGS
TGS (Ticket Granting Service) is used by user to access any service he wants
KDC/DC replies with TGS encrypted with service's NTLM hash
Then user connects to the server hosting that service using TGS
Golden Ticket Attack
breaking step 3 of kerberos if we are able to send a TGT to KDC by encrypting it with krbtgt user's hash which makes it valid TGT For this we need krbtgt user access as it is a DC account , for this we need domain admin privileges COMMANDS :-
disable defender or asmr
set-mpprefrence -DisableRealtimemonitoring $trueDownload mimikatz
Load mimikatz in powershell
Execute mimikatz on Domain controller as Domain Admin to get krbtgt hash
creating a golden ticket
Breakdown of the command :-
kerboros::golden module name /User:Administrator user name /domain:dollarcorp.moneycorp.local domain name /sid:s-2-3-43-3456789-678904-456789 sid of domain /krbtgt:cfrt678iujnmko987689o345rf098uh krbtgt user hash /id:500 /group:512 optional user RID (default 500) & group (512-520) /startoffset:0 optional when ticket is available /endin:600 optional ticket lifetime /renewmax:10080 optional ticket lifetime renewal /ptt or /ticket injects in current powershell session save a ticket in file
optional = run this command to get powershell session with domain admin privileges
DCsync attack we can also get krbtgt hash using dcsync attack
Silver Ticket attack
breaking step 5 of kerboros
use mimikatz to get hash of all users
NOTE:- we need domain controller hash to create a silver ticket
2. creating silver ticket
other services :- HOST , RPCSS , CIFS , WSMAN , WMI this command tell us what services we can use as domain controller , we can use this comand after injecting silver ticket
command execution using silver ticket
crate a silver ticket for HOST SPN
list all scheduled tasks
Schedule a task
it will download the reverse shell , make sure to customize it before executing
4. Turn on reverse shell listener
Execute that task
Diamond Ticket attack
Skeleton Key
It is a presistance technique to patch a domain controller (lsass process) so it can allow any user with single same password
Injecting Skeleton Key default pass = mimikatz
After injecting we can access any machine we want with username & pass = mimikatz
DSRM Directory service restore mode
Rarely changed The DSRM password is same of local admin (Administrator) password of DC dump DSRM password
After getting the hash , cross check the hash with
if the hash is same we can perform pass the hash , but before using this hash we need to change the logon behaviour of DSRM
or
after changing the property we can check it
Pass The Hash
AdminDSHolder
AdminSDHolder is used to maintain ACL or control permission for privileged groups (protected groups) SDPROP = Security Descriptor Propagator SDPROP is the process which runs every 60 min in the system , and when it runs it overwrites the ACL by AdminSDHolder ACL Protected Groups :-
Account Operators
Backup Operators
Server Operators
Print Operators
Domain Admins
Replicators
Enterprise Admins
Domain Controllers
Read-only Domain Controllers
Schema Admins
Administrators
commands
Load SDpropagator
Add fullcontrol permission for a user to adminsdholder as domain admin
Reset password for a user to adminsdholder
Write Members for a user to adminsdholder
adding user to domain admin groups
add rights for dcsync
execute dcsync
Security Descriptors
it is use to modify security descriptors (security information :- owner , group , DACL , SACL)
commands
WMI
ACL can be modified using non admin access on local machine
on remote machine without explicit credentials
on remote machine with explicit credentials
on remote machine remove permission
Powershell remoting
on local machine
on remote machine
on remote machine , remove permission
Remote registry
Load script
using DAMP with admin privs on remote machine
Retrieve hash
machine account hash
local account hash
domain cache credentials
Last updated