TR18 AD MSFT Defence at Scale
TR18 AD MSFT Defence at Scale
TR18 AD MSFT Defence at Scale
environments at scale
Vineet Bhatia (@ThreatHunting)
15 Mar 2018
Agenda
• Introduction and Background
• Microsoft security stack in Windows 10
• Defense model based on MITRE ATTACK and the Microsoft stack
• Event data collection at scale and the role of telemetry
• Security stack in the cloud (Azure, Office365)
• Q&A
Windows Defender SmartScreen Credential Guard Enterprise Cert. Pinning Memory Protections
• App and website reputation checks. • Virtualization of security process. • Protect internal domains from chaining. • Control Flow Guard: http://bit.ly/2DnSarz
• Checks run when app is first run. • Protects secrets such as NTLM and KTGT. • Pin X509 Cert and Public Key to the root. • Code Integrity Guard
• Only performed on downloaded apps. • Windows 10 and Server 2016 covered. • Arbitrary Code Guard: http://bit.ly/
• E.g.: Detects crypto-currency miners: 2Gryeam
http://bit.ly/2tPVeNM • Windows Defender Exploit Guard: http://
bit.ly/2p7EDjS
• Previously limited to DEP/SEHOP/ASLR.
Privilege Escalation Credential Access Lateral Movement Collection Command and Control
Enter system as unpriv user Obtaining access or control of Enable access to other systems Gather sensitive files from Adversary communication on/
and exploit vulnerabilities to system, domain or service on network with/wout network prior to exfil. to target network.
become SYSTEM or Admin. creds. execution of tools.
Discovery
Collection
C2 / Exfil Lateral
Movement
Device
Guard Credential
Guard
Defense
Evasion
Credential WEF
Single Platform Access
Approach
Privilege
Escalation
Persistence
WDATP
Execution
ATA /
Azure ATP
Exploit
Guard
Higher efficiency controls Defender
Application Smart-
Guard screen
https://twitter.com/
mattifestation/status/
972654625554771969
https://twitter.com/
ncsc/status/
973122188344791040
SETHC.exe
4656 - A handle to a Registry key or Sysmon Event ID Enable registry auditing: auditpol /
Accessibility UTILMAN.exe
Registry Value was requested.
12,13 and 14 - set /subcategory:”Registry” /
Features OSK.exe
4657 - A registry value was modified.
Registry success:enable
Magnify.exe
4660 - An registry key or value was deleted Modification
Narrator.exe
or removed.
DisplaySwitch.exe
4663 - An attempt was made to access a
AtBroker.exe Registry key or Registry Value
Look for changes to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microso
ft\Windows NT\CurrentVersion\Image File
Execution Options\{name of the
executable}
User32.dll loading 4657 - A registry value was modified.
Sysmon Event ID 7 - The AppInit DLL functionality is
AppInit DLLs unknown third party DLL
DLL (image) load by disabled in Windows 8 and later
Look for changes or any new DLL locations process
versions when secure boot is
being added to:
enabled.
HKEY_LOCAL_MACHINE\Software\Microsoft User32.dll loading
\Windows NT\CurrentVersion\Windows OR unusual DLL should https://github.com/threathunting/
HKEY_LOCAL_MACHINE\Software\Wow6432 trigger sysmon-config/blob/master/
Node\Microsoft\Windows sysmonconfig-export.xml#L260
NT\CurrentVersion\Windows
Also consider running this on all
systems and pulling data back for
analysis:
autorunsc -a d -h -m -s -u *
If you pooled your data into a SIEM of your choice, you could search event data using structured
queries.
Example, on Splunk, you could search the sysmon index :
`sysmon` EventCode=1 (
(ParentImage=*\\winlogon.exe
((Image=*\\Utilman.exe CommandLine=*/debug*) OR (Image=*\\sethc.exe (CommandLine=*sethc.exe 211*
OR CommandLine=*sethc.exe 101*)))) OR (ParentImage=*\\utilman.exe (CommandLine=*osk.exe* OR
CommandLine=*magnify.exe* OR CommandLine=*narrator.exe* OR CommandLine=*DisplaySwitch.exe* OR
CommandLine=*AtBroker.exe*))) | table _time, host, Image, CommandLine, ParentProcessId, ParentImage,
ParentCommandLine, User
Windows Defender Advanced Threat Protection (WDATP) includes a new module that allows you to
query the backend schema directly. This capability is called Advanced Hunting. See: http://bit.ly/2p6O8zI
//Accessibility_features_misuse_detection
RegistryEvents
| where EventTime >= ago(1h)
| where RegistryKey contains
@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Image File Execution Options”
| project InitiatingProcessParentName, InitiatingProcessFileName,
ActionType, RegistryKey, RegistryKeyValueType, RegistryKeyValueName,
RegistryKeyValueData, RegistryKeyPreviousKeyValueName,
RegistryKeyPreviousKeyValueData
//AppCertDLL_detection
RegistryEvents
| where EventTime >= ago(1h)
| where RegistryKey contains @"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session
Manager\AppCertDlls”
| project InitiatingProcessParentName, InitiatingProcessFileName, ActionType, RegistryKey,
RegistryKeyValueType, RegistryKeyValueName, RegistryKeyValueData,
RegistryKeyPreviousKeyValueName, RegistryKeyPreviousKeyValueData
//AppInitDLL_detection
RegistryEvents
| where EventTime >= ago(1h)
| where RegistryKey contains @"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows
NT\CurrentVersion\Windows" or RegistryKey contains
@"HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Windows"
| project InitiatingProcessParentName, InitiatingProcessFileName, ActionType, RegistryKey,
RegistryKeyValueType, RegistryKeyValueName, RegistryKeyValueData,
RegistryKeyPreviousKeyValueName, RegistryKeyPreviousKeyValueData
Gibin John:
https://github.com/beahunt3r/Windows-Hunting
Examples:
• Detecting Impacket Use in the Organization.
• Identifying BITSAdmin execution.
• ProcDump execution.
Approve remediation in
workflow (Step 3)
Machine fully
remediated (Step 4)
Defending Microsoft
environments at scale
Vineet Bhatia (@ThreatHunting)
https://github.com/threathunting/Published-
Content