Unveiling Active Directory Secrets
Unveiling Active Directory Secrets
Directory Secrets
French group
250 000
employees Participation of 40% from VINCI Airports
C0 - VINCI Public 2
About us
Tanguy LE BRETTON
VINCI-CERT analyst
Vincent has already spoken at
many conferences (FIRST,
BlackHat US&EU, BlueHatIL,
RomHack, HackinParis, …)
Marc VILLAIN
Security Project Manager
https://www.vinci.com/cert mostly on Active Directory
topics (PingCastle & Mimikatz)
Ewen FERTIL
VINCI-CERT analyst
@mysmartlogon
C0 - VINCI Public 3
Level of
Introduction difficulties /
understanding /
impact
What is this ?
! I’m using a Windows 2008 for the presentation because I own a license. But all the items presented works on newer OS
C0 - VINCI Public
In Summary
C0 - VINCI Public
Unusual configuration
6
C0 - VINCI Public
#1: user vs inetOrgPerson classes Easy
What is this ? Why it is a problem ? How to fix it / detect it / mitigate it ?
C0 - VINCI Public
#2: Backup files of GPO are not replicated Easy
What is this ? Why it is a problem ? How to fix it / detect it / mitigate it ?
C0 - VINCI Public
#3 forgotten Ownership of AD Objects Easy
What is this ? Why it is a problem ? How to fix it / detect it / mitigate it ?
C0 - VINCI Public
Stay silent
10
C0 - VINCI Public
#4 Anonymous Bind Usage Easy
What is this ? Why it is a problem ? How to fix it / detect it / mitigate it ?
« Anonymous bind » can be used on Can be disabled only starting Windows Server
every DC. 2019 (DenyUnauthenticatedBind)
Basic information about the server FQDN,
OS type, …
C0 - VINCI Public
#5 NT4 API Abuse
Advanced
What is this ? Why it is a problem ?
CLEAR TEXT
You can set your password without the password in clear text.
PASSXORD
Hash update if
password
changed No password complexity checks.
DENIED ! PASSWORD NOT
COMPLEX ENOUGH
01011
11001 How to fix it / detect it / mitigate it ?
CLEAR TEXT NTLM HASH
PASSXORD RPC firewall can block SamrChangePasswordUser.
The other call SamrSetInformationUser is used for genuine purpose
DONE !
No solution for the moment.
C0 - VINCI Public
#5 Demo !
https://github.com/vletoux
/NTLMInjector
Limits:
• Change password to
zero char ✗
• Usable for kerberos
AES256 ✗ (immediate
password change
proposed at login time)
C0 - VINCI Public
#6 Dynamic Objects for Stealth
Medium
What is this ? Why it is a problem ? How to fix it / detect it / mitigate it ?
A special class that add ends of life to objects at a specific date. Leave no traces, even in recycle bin. Track object creation and add a filter on
Minimum lifetime: 1h No replication logs at deletion. objectclass
Needs to be specified at creation time. Cannot be granted later
[int]$intDynTTL = “15”
$intDynTTL = $intDynTTL * 60
$objDomain = New-
Object System.DirectoryServices.DirectoryEntry(“LDAP://O
U=Accounts,DC=contoso,DC=com”)
$objName = “DYNUSER1”
$objDyn = $objDomain.Create(“user”, “CN=” + $objName)
$objDyn.Put(“objectClass”, @(“dynamicObject”,“user”) )
$objDyn.Put(“entryTTL”, $intDynTTL )
$objDyn.Put(“sAMAccountName”, $objName )
$objDyn.SetInfo()
C0 - VINCI Public
#7 AV Detection via SID Resolution
Advanced
What is this ? Why it is a problem ?
SERVICE NAME
C0 - VINCI Public
Demo
https://github.com/vletoux/TestAntivirus
Or
https://www.pingcastle.com/download C0 - VINCI Public
#8 Abuse network auth to get password
Advanced
What is this ? Why it is a problem ?
If you want to test a password, you can check if the crypto matches.
DONE !
NTLM HASH
C0 - VINCI Public
Demo !
https://github.com
/vletoux/DetectPas
swordViaNTLMInFl
ow
C0 - VINCI Public
Admin trick
C0 - VINCI Public
#9 Smart card logon for dummies
Medium
What is this ? How to use it ?
Step2: Use it
Demo !
Linux : Use OpenSC
Why it is NOT a problem ?
#1: insert an
empty card
0:00 -> 0:11
#3: personalize
applet (set PIN)
1:00 -> 1:24
#4: Request
CERT
1:24 -> 2:15
C0 - VINCI Public
#10 AD Denial of Service Easy
What is this ? Why it is a problem ? How to fix it / detect it / mitigate it ?
I don’t know !
https://medium.com/@nannnu/the-f-c-urious-case-of-the-
DC ldapipdenylist-8e5799cd9ce
LdapIpDenyList
Attribute
Is the incoming IP in
the LDAP IP-Deny List ?
C0 - VINCI Public
#10 AD Denial of Service - Demo
C0 - VINCI Public
Investigate
24
C0 - VINCI Public
#11: Replication Data and LDAP notifications Easy
What is this ? Why it is NOT a problem ? How to use it ?
A) Information in public access to debug replication issue A) Used to know in IR when data has been changed:
C0 - VINCI Public
#12: DPAPI Key Vulnerability Reminder Easy
What is this ? Why it is a problem ? How to fix it / detect it / mitigate it ?
Hunting:
Compromise checklist
User password AD Master key
Investigate Event 4662 with object bckupkey
Reset:
- the krbtgt ✓
DPAPI
- Service accounts ✓
- the admin passwords ✓
- the user passwords ✓
Passwords
https://learn.microsoft.com/en-us/windows/win32/seccng/cng-
dpapi-backup-keys-on-ad-domain-controllers
C0 - VINCI Public
Conclusion
6/14/2024
Direction des Systèmes d’Information Groupe - CONFIDENTIEL 27
C0 - VINCI Public
In Summary
Question ?
C0 - VINCI Public