Active Directory How To Change A Weak Point Into A Leverage For Security Monitoring
Active Directory How To Change A Weak Point Into A Leverage For Security Monitoring
1822 1858 1880 1895 1946 1990 1997 2000 2001 2008 2015
Société Générale Compagnie Société Lyonnaise Compagnie Mutuelle Gaz de Electrabel Suez Lyonnaise International Power SUEZ GDF SUEZ ENGIE
des Universelle des Eaux de Tramways France des Eaux
Pays-Bas du Canal Maritime et de l’Éclairage
de Suez
2017-06-12 First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 3
Why focusing on Active
Directory ?
Does it remind something to you ?
Your organization
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 5
Not castles from fairy tales
Trust everyone
forgot …
Corporate AD
Reorganization
(never completed)
Active
Directory Critical
inside application
connected to
Company bought AD
Merger
External companies
Active Directory
Active inside
Directory
inside
Join Venture
Business as usual
The reality
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 6
Quizz: Who can become the domain admins (or more) ?
Built-in Administrators
net group "Domain Admins" %username% /DOMAIN /ADD
Server Operators
C:\>sc config browser binpath= "C:\Windows\System32\cmd.exe /c net group \" Domain Admins\"
%username% /DOMAIN /ADD" type= "share" group= "" depend= ""
[SC] ChangeServiceConfig SUCCESS
C:\>sc start browser
[SC] StartService FAILED 1053:
The service did not respond to the start or control request in a timely fashion.
Print operators (well, it has the right to logon to DC and discover
password in batches or copy ntdis.dit backup)
Account operators
net group “badgroup" %username% /DOMAIN /ADD => see slide after for the choice of the group
Backup operators
Backup C:\Windows\SYSVOL\domain\Policies\{*}\MACHINE\Microsoft\Windows NT\SecEdit\GptTmpl.inf
Restore: with [Group Membership]
*S-1-5-32-544__Members = <etc etc etc>,*S-1-5-21-my-sid
Then DCSync krbtgt => Golden ticket => Enterprise admins (see later)
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 7
Focusing on AD
vulnerabilities
Extended rights
Where are your admins ?
admin1
Users
Domain
Administrators
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 9
Pass the hash / over pass the hash / pass the ticket / golden ticket / silver
ticket …
Lsass.exe
NTLM
Pass the HASH NTLM:123456789
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 10
Silver ticket + DCSync : being compromise without knowing it
Detecting silver tickets requires to collect all kerberos events on ALL computers
Silver / Golden tickets still valid if created with the old password (to avoid replication problem)
One kerberos ticket can have a field containing a « SID History » record. Used for migration but
not only (used to contain forest group membership)
One golden / silver ticket can have a field« SID History » forged (example: forest admin SID)
10-30% of domains vulnerable, 100% of the users, including trusted domains enumerated
Consequences:
Block all the accounts if a locking policy is in place (including those in trusted domains)
Locate weak accounts and bruteforce passwords
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 13
Monitoring the domains
(that we don’t control)
Our recipe
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 16
The script: example of rules
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 17
Abusing trusts to discover domains
Forest 2
Golden rule:
Assign the « discovered
domains » to the AD owning the
trust (and then to the BU)
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 19
Management vision about AD
Simplified view …
Group risks are easier to mitigate (and they have the higher impact)
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 23
ENGIE strategy about securing Active Directory
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 24
3 priorities for BU CIO and CISO defined in 2017
Then
Improve the score (min: 50/100)
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 26
Market orientation
AD Specific solutions
Monitoring
Gap
Generic solutions
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 27
Monitoring gap: no vulnerability analysis
Normal admins Personal account
owner of the
provisionning service
account
Personal admin
account put in domain
admins
Helpdesk
https://github.com/ANSSI-FR/AD-control-paths - bloodhound
Bonus: who can owns the CEO
2017-06-12
account ?
First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 28
A possible strategy based on risks
Mitigate
hackers’ risk
Focus (and limit the budget) to high value AD – accept the risk for ohers
2017-06-12 First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 29
Hackers’ roadmap
PowerSploit
Powershell Powershell empire (Python) Responder
(Invoke-mimiktaz)
RDP attacks
DCSync with MakeMeEnterpriseAdmin
« Mimikatz 2 »
Netlogon RPC
DCSync / Golden
ticket in
c#/powershell
Bypassing SID Filtering with forest trust
by abusing non removed SID History
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 30
Hardening roadmap
Google PIV /
GIDS smart
card
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 31
Conclusion
Lessons learned
2017-06-12 First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 33
Conclusion
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 34
Questions ?
Tool: http://www.pingcastle.com
Bonus slide: Some KPI
Domain cleaning
Switch to continuous auditing
Initial deadline
mode at 87% and after 9
months
SID Filtering KPI was changed from “enabled only” to “not enable” (3 states: Yes, No, Not applicable). SID Filtering evolution is
most of the time related to a direct order of the corporate.
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 36
Bonus slide: Owning trusted domain
(Bypassing SID Filtering - and unidirectional trust)
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 37
Bonus slide: SID Filtering
SID Filtering Active => If forest trust and not inter forest trust => Yes ; else if quarantined domain => Yes
Enabling it:
Forest trust: enabled by default => netdom /enableSIDHistory = NO
Do not enable Quarantine on a forest trust !!! (users from child domains in the forest won’t be
authenticated anymore)
2017-06-12 First Conference 2017 - First Conference 2017 - Active directory : How to change a weak point into a leverage for security monitoring 38