Tips & Tricks
Tips & Tricks
PowerShell
Running a service in the background (Equivalent of using the & at the end of a command Linux):
Killing the initial shell WILL kill the sub process. Only use this command if you know that initial shell will remain active.
Command Prompt
Running a service in the background (Equivalent of using the & at the end of a command Linux):
Killing the initial shell WILL kill the sub process. Only use this command if you know that initial shell will remain active.
Downloading and Running a EXE in Memory
Get a list of tickets
Extract:
Use the extracted ticket:
Jump into the process with that token
You can also force Computer objects to authenticate with the service and steal their tickets: Monitor for new tickets with Rubeus:
Run SharpSpoolTrigger to force authentication
DC-2 is the target and WEB is the listener
Machine tickets can be used using the S4U2Self Abuse method.
Constrained Delegation
This aims to restrict the services to which the server can act on behalf of a user. The constrains no longer allow the server to cache TGTs of other users. Instead, it is only allowed to get TGS for another user with its own TGT.
Finding computers with constrained delegation:
Finding users with constrained delegation:
Constrained delegation can be configured on user accounts as well as user accounts.
First, we need the TGT of the account (user or computer) that is trusted for delegation. You can get this with the dump
command of Rubeus.
If you have the NTLM or AES hash of the user, you can request the TGT using the asktgt
in Rubeus.
Next you can perform a S4U request to obtain a usable TGS for the allowed service.
/impersonateuser
is the user we want to impersonate - they should have local admin access on the target machine. nlamb is a domain admin which is required for accessing the domain controller./msdsspn
is the service principal name that SQL-2 is allowed to delegate to./user
is the principal allowed to perform the delegation./ticket
is the TGT for/user
.
The above will perform a S4U2Self and then S4U2Proxy to get the S4U2Proxy ticket needed.
Create a process we can steal:
Steal the process:
Alternate Service Name
https://www.secureauth.com/blog/kerberos-delegation-spns-and-more/ When configuring Kerberos Constrained Delegation, keep in mind that you are delegating credentials not only to the service type you specified but also to the rest of the service types running under the same account. Also, the SPN specified in the sname field, doesn’t seem to be used as part of the authentication mechanism.
However, the sname
field of the ticket is not signed and can be tampered with. So you can change the sname
of the ticket to another sname
that is being ran by the same account as the previous one and get access to the requested SPN.
You can abuse this with Rubeus
If you get LDAP on the DC, you can perform a dcsync attack.
S4U2Self Abuse
S4U2Self allows a service to obtain a TGS to itself on behalf of another user. S4U2Proxy allows a service to obtain a TGS on behalf of a user to another service.
If we have the TGT of the computer that can perform S4U2Self, we can request to impersonate any user to the service provided by that account.
The /self
flag is used to get a TGS on behalf of another user to itself.
You can then use that ticket to create a process as that user and use that to authenticate to other systems.
Last updated
Was this helpful?