SlideShare une entreprise Scribd logo
1  sur  17
Windows Threat Hunting
Null Dubai
2016
GIBIN JOHN
Incident Triage
Triaging an incident defines the success of incident response. The latest attacker tools and
techniques are increasingly stealthy and happens in multiple stages, which makes traditional AVs
helpless.
Identifying key indicators and finding the artifacts will decide how effectively you can do incident
triage.
Some key questions triaging should address are:
Identifying potential malwares
Identifying the mode of Infection
Identifying how they lateral movements
Identifying Privilage Escalation and Persistence Mechanism
And what was it trying to accomplish?
Many things to look at….
•Processes
•Network connections and listening ports
•Filesystem
•Logs
• Autoruns
• Prefetch
•Scheduled Tasks (At jobs)
•LNKs
•ShimCache
• AmCache
• RecentFileCache
• Recycler
• HIVEs
• ldrmodules / dlllist
• BIOS
• MBR
•Rogue Services
• Volatile/RAW memory
• MFT
Etc…
General Hunting Scenarios
- Hunting with intelligence
◦ Consume threat intelligence
◦ Yarascan for know malwares, web shells and other indicators.
◦ Search based on Intel's – IOC (Open-IOC, STIX, Hash, TTP, Filenames etc..)
◦ Network and host based indicators.
- Hunting with zero intelligence
◦ Collect specific data from all your hosts.
◦ Look for anomalies and outliers
◦ Network and host forensics.
Windows Task Scheduler
 Schedules commands and programs to run periodically or at a specific time.
Task can be scheduled using ‘schtasks.exe’, ‘task scheduler’, ‘at.exe’
 A persistence method which can possibly do privilege escalation/lateral movement
◦ Location:
◦ C:WindowsTasks (XP - Windows Job Format)
◦ C:WindowsSystem32Tasks (Win7+ - XML)
◦ C:WindowsSysWow64Tasks (Win7+ - XML)
◦ C:> schtasks
◦ Files for triage -
◦ C:WindowsTasksSchedlgu.txt
◦ C:WindowsTasksAt*.job
◦ C:WindowsSystem32winevtLogsMicrosoft-Windows-TaskScheduler*
Legitimate Windows file rundll32.exe has been scheduled as a job to load a malicious DLL with export function “Afght”
ShimCache
PARSER-
https://github.com/mandiant/ShimCacheParser/blob/master/ShimC
acheParser.py
o Windows Application Compatibility Database – Used by operating system to identify
application compatibility issues
o Good source for while investigating lateral movement
Records -
File Full Path, File Size, $Standard_Information (SI) Last Modified time, Shimcache Last Updated time,
Process Execution Flag
Location:
HKLMSYSTEMCurrentControlSetControlSession Manager
AppCompactCache|AppCompatibilityAppCompatCache
Cont..
Indicators to start with >
Keep and eye on -
◦ Directories like system32, %temp% , %Windows%, Recycle, %AppData%
Web root Directories - Inetpub, wwwroot, etc..
◦ Reserved file names and its location.
◦ Binaries with less than 1000 bytes in size.
◦ Single, double and triple character file names.
◦ Files with suspicious extensions (rar, tmp, tar, dat, etc..).
◦ Hidden files, batch files, scripts, *.job, at*.job etc..
◦ Search based on specific date and time.
◦ Search based on suspicious file names (svch0st.exe, scvhost.exe, expl0ree.exe etc)
Etc..
AmCache & RecentFileCache
AmCache
Helpful in identifying recently executed application.
• C:WindowsAppCompatProgramsAmcache.hve)
RecentFileCache
Useful in identifying evidence of suspicious process creation
C:WindowsAppCompatProgramsRecentFileCache.bcf
Rogue Services
• A service is a program that is automatically started by Windows NT/XP/2000/2003 on startup or
through some other means and is generally used for programs that run in the background.
• Service can be loaded on start-up either by –
◦ Windows directly – File that launches the service can be found in HKEY_LOCAL_MACHINESYSTEM
CurrentControlSetServicesservicename
• Using svchost.exe
HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionSvchost
Demo..
• A simple bat script to install a backdoor as a service using svshost.exe ..
Tools –
SysInternals Suite (PsService.exe etc..)
http://www.bleepingcomputer.com/download/getservices/
Common Indicators to detect Rogue
Services >
 Look for suspicious services registry entry (eg- Registry access denied message
on HIPS @ImagePath Or @ServiceDll entry )
 Error Control Set = 0 (User will not get service fails erroe during startup.)
 Services running from program data.
 Autorun enabled on unsigned ServiceDLL.
 Auto Start (Type 2) services with suspicious names ..
Timeline Analysis using MFT
 MFT analysis is helpful to identify if any additional tools were dropped on the system and also
other artefacts left due to the execution of the malware.
 NTFS has 8 timestamps
 Standard Information Attribute ($SI)
 Filename Information Attribute ($FN) - They are not exposed to user space.
 Both $SI and $FN has 4 time stamps (crtime, mtime, atime and MFT Entry Modified)
 Worth checking if you identified a files that are time stomped.
 TimeStomp module in msf
https://www.offensive-security.com/metasploit-unleashed/timestomp/
DLL Side Loading
 A popular cyber attack method that takes advantage of how Microsoft Windows applications
handle DLL files.
 When an exe is loading the windows loader will parse the IAT and load it by checking the
following registry key (A list of Known windows dlls) -
HKEY_LOCAL_MACHINESystemCurrentControlSetControlSession ManagerKnownDLLs
◦ And if any dll being imported is not in the list of knowndll, it will search on the current directory of the
executable module.
Attackers can take advantage of this and can load a malicious on a genuine executable.
Possible Indicators –
 Unsigned dll loaded in process, Autorun, Services running from suspicious location, Unknown DLL import
DLL injection – User Mode Rootkits
[Demo]
• Identifying the DLLs loaded by a process at runtime is a vaulbe information, as it is a common
technique used by rootkits – “Dll Injection”.
Unsigned creates remote thread
Autorun
Where are the autoruns?
•Registry run keys
•Services
•Drivers
•Browser add-ons
……
Wdigest downgrade
• One common attack vector that has been around for several years is to use a tool called
Mimikatz and steal cleartext credentials from memory of compromised Windows systems.
• Newer versions such as Windows 8 / 10 and Windows Server 2012 / 2016 introduced a registry
setting that disables storage of clear-text for credentials the WDigest provider by default.
If the value of UseLogonCredentialvalue is set to “1”, WDigestwill store credentials in clear
text in memory and might be an indication attempt of password dumping.
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersWDigestUseLog
onCredential
• KB2871997 “back-ports” the registry setting to Windows 7, 8, Server 2008R2 and 2012.
Thank You !!!

Contenu connexe

Tendances

Fantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find ThemFantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find Them
Ross Wolf
 

Tendances (20)

BSidesLV 2016 - Powershell - Hunting on the Endpoint - Gerritz
BSidesLV 2016 - Powershell - Hunting on the Endpoint - GerritzBSidesLV 2016 - Powershell - Hunting on the Endpoint - Gerritz
BSidesLV 2016 - Powershell - Hunting on the Endpoint - Gerritz
 
Threat hunting - Every day is hunting season
Threat hunting - Every day is hunting seasonThreat hunting - Every day is hunting season
Threat hunting - Every day is hunting season
 
MW_Arch Fastest_way_to_hunt_on_Windows_v1.01
MW_Arch Fastest_way_to_hunt_on_Windows_v1.01MW_Arch Fastest_way_to_hunt_on_Windows_v1.01
MW_Arch Fastest_way_to_hunt_on_Windows_v1.01
 
PowerShell for Practical Purple Teaming
PowerShell for Practical Purple TeamingPowerShell for Practical Purple Teaming
PowerShell for Practical Purple Teaming
 
Threat Hunting Report
Threat Hunting Report Threat Hunting Report
Threat Hunting Report
 
Cyber Threat Hunting Workshop
Cyber Threat Hunting WorkshopCyber Threat Hunting Workshop
Cyber Threat Hunting Workshop
 
Threat Hunting Procedures and Measurement Matrice
Threat Hunting Procedures and Measurement MatriceThreat Hunting Procedures and Measurement Matrice
Threat Hunting Procedures and Measurement Matrice
 
Bsides 2019 - Intelligent Threat Hunting
Bsides 2019 - Intelligent Threat HuntingBsides 2019 - Intelligent Threat Hunting
Bsides 2019 - Intelligent Threat Hunting
 
Cyber Threat Hunting with Phirelight
Cyber Threat Hunting with PhirelightCyber Threat Hunting with Phirelight
Cyber Threat Hunting with Phirelight
 
Threat Hunting for Command and Control Activity
Threat Hunting for Command and Control ActivityThreat Hunting for Command and Control Activity
Threat Hunting for Command and Control Activity
 
Cyber Threat Hunting: Identify and Hunt Down Intruders
Cyber Threat Hunting: Identify and Hunt Down IntrudersCyber Threat Hunting: Identify and Hunt Down Intruders
Cyber Threat Hunting: Identify and Hunt Down Intruders
 
Detection Rules Coverage
Detection Rules CoverageDetection Rules Coverage
Detection Rules Coverage
 
Threat Hunting with Splunk
Threat Hunting with SplunkThreat Hunting with Splunk
Threat Hunting with Splunk
 
Threat Hunting with Splunk
Threat Hunting with SplunkThreat Hunting with Splunk
Threat Hunting with Splunk
 
Finding attacks with these 6 events
Finding attacks with these 6 eventsFinding attacks with these 6 events
Finding attacks with these 6 events
 
Threat hunting on the wire
Threat hunting on the wireThreat hunting on the wire
Threat hunting on the wire
 
Kheirkhabarov24052017_phdays7
Kheirkhabarov24052017_phdays7Kheirkhabarov24052017_phdays7
Kheirkhabarov24052017_phdays7
 
Effective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat IntelligenceEffective Threat Hunting with Tactical Threat Intelligence
Effective Threat Hunting with Tactical Threat Intelligence
 
Fantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find ThemFantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find Them
 
Threat Hunting
Threat HuntingThreat Hunting
Threat Hunting
 

En vedette

En vedette (20)

Abstract Tools for Effective Threat Hunting
Abstract Tools for Effective Threat HuntingAbstract Tools for Effective Threat Hunting
Abstract Tools for Effective Threat Hunting
 
SOC2016 - The Investigation Labyrinth
SOC2016 - The Investigation LabyrinthSOC2016 - The Investigation Labyrinth
SOC2016 - The Investigation Labyrinth
 
Threat Hunting Workshop
Threat Hunting WorkshopThreat Hunting Workshop
Threat Hunting Workshop
 
Art into Science 2017 - Investigation Theory: A Cognitive Approach
Art into Science 2017 - Investigation Theory: A Cognitive ApproachArt into Science 2017 - Investigation Theory: A Cognitive Approach
Art into Science 2017 - Investigation Theory: A Cognitive Approach
 
Splunk for Developers Breakout Session
Splunk for Developers Breakout SessionSplunk for Developers Breakout Session
Splunk for Developers Breakout Session
 
Splunk for Security - Hands-On
Splunk for Security - Hands-On Splunk for Security - Hands-On
Splunk for Security - Hands-On
 
Building a Successful Threat Hunting Program
Building a Successful Threat Hunting ProgramBuilding a Successful Threat Hunting Program
Building a Successful Threat Hunting Program
 
Workshop threat-hunting
Workshop threat-huntingWorkshop threat-hunting
Workshop threat-hunting
 
BSides Augusta 2015 - Building a Better Analyst Using Cognitive Psychology
BSides Augusta 2015 - Building a Better Analyst Using Cognitive PsychologyBSides Augusta 2015 - Building a Better Analyst Using Cognitive Psychology
BSides Augusta 2015 - Building a Better Analyst Using Cognitive Psychology
 
Hunting: Defense Against The Dark Arts - BSides Philadelphia - 2016
Hunting: Defense Against The Dark Arts - BSides Philadelphia - 2016Hunting: Defense Against The Dark Arts - BSides Philadelphia - 2016
Hunting: Defense Against The Dark Arts - BSides Philadelphia - 2016
 
Threat Hunting with Splunk
Threat Hunting with SplunkThreat Hunting with Splunk
Threat Hunting with Splunk
 
Deeplook into apt and how to detect and defend v1.0
Deeplook into apt and how to detect and defend v1.0Deeplook into apt and how to detect and defend v1.0
Deeplook into apt and how to detect and defend v1.0
 
Luncheon 2016-07-16 - Topic 2 - Advanced Threat Hunting by Justin Falck
Luncheon 2016-07-16 -  Topic 2 - Advanced Threat Hunting by Justin FalckLuncheon 2016-07-16 -  Topic 2 - Advanced Threat Hunting by Justin Falck
Luncheon 2016-07-16 - Topic 2 - Advanced Threat Hunting by Justin Falck
 
Logs, Logs, Logs - What you need to know to catch a thief
Logs, Logs, Logs - What you need to know to catch a thiefLogs, Logs, Logs - What you need to know to catch a thief
Logs, Logs, Logs - What you need to know to catch a thief
 
Logging for Hackers v1.0
Logging for Hackers v1.0Logging for Hackers v1.0
Logging for Hackers v1.0
 
Proper logging can catch breaches like retail PoS
Proper logging can catch breaches like retail PoSProper logging can catch breaches like retail PoS
Proper logging can catch breaches like retail PoS
 
The top 10 windows logs event id's used v1.0
The top 10 windows logs event id's used v1.0The top 10 windows logs event id's used v1.0
The top 10 windows logs event id's used v1.0
 
Building an EmPyre with Python
Building an EmPyre with PythonBuilding an EmPyre with Python
Building an EmPyre with Python
 
I hunt sys admins 2.0
I hunt sys admins 2.0I hunt sys admins 2.0
I hunt sys admins 2.0
 
Cyber Weapons
Cyber WeaponsCyber Weapons
Cyber Weapons
 

Similaire à Windows Threat Hunting

Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
EPAM Systems
 

Similaire à Windows Threat Hunting (20)

Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1
 
Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1
 
CNIT 152: 12b Windows Registry
CNIT 152: 12b Windows RegistryCNIT 152: 12b Windows Registry
CNIT 152: 12b Windows Registry
 
CNIT 152 12 Investigating Windows Systems (Part 2)
CNIT 152 12 Investigating Windows Systems (Part 2)CNIT 152 12 Investigating Windows Systems (Part 2)
CNIT 152 12 Investigating Windows Systems (Part 2)
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
 
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
 
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
 
SANS Digital Forensics and Incident Response Poster 2012
SANS Digital Forensics and Incident Response Poster 2012SANS Digital Forensics and Incident Response Poster 2012
SANS Digital Forensics and Incident Response Poster 2012
 
Intrusion Discovery on Windows
Intrusion Discovery on WindowsIntrusion Discovery on Windows
Intrusion Discovery on Windows
 
Building next gen malware behavioural analysis environment
Building next gen malware behavioural analysis environment Building next gen malware behavioural analysis environment
Building next gen malware behavioural analysis environment
 
Practical Malware Analysis: Ch 11: Malware Behavior
Practical Malware Analysis: Ch 11: Malware BehaviorPractical Malware Analysis: Ch 11: Malware Behavior
Practical Malware Analysis: Ch 11: Malware Behavior
 
CNIT 126 11. Malware Behavior
CNIT 126 11. Malware BehaviorCNIT 126 11. Malware Behavior
CNIT 126 11. Malware Behavior
 
CNIT 126 Ch 11: Malware Behavior
CNIT 126 Ch 11: Malware BehaviorCNIT 126 Ch 11: Malware Behavior
CNIT 126 Ch 11: Malware Behavior
 
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)
 
CHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
CHAPTER 3 BASIC DYNAMIC ANALYSIS.pptCHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
CHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
 
Intrusion Discovery Cheat Sheet for Linux
Intrusion Discovery Cheat Sheet for LinuxIntrusion Discovery Cheat Sheet for Linux
Intrusion Discovery Cheat Sheet for Linux
 
how-to-bypass-AM-PPL
how-to-bypass-AM-PPLhow-to-bypass-AM-PPL
how-to-bypass-AM-PPL
 
Antivirus is hopeless
Antivirus is hopelessAntivirus is hopeless
Antivirus is hopeless
 
First Responders Course - Session 6 - Detection Systems [2004]
First Responders Course - Session 6 - Detection Systems [2004]First Responders Course - Session 6 - Detection Systems [2004]
First Responders Course - Session 6 - Detection Systems [2004]
 
Anton Chuvakin on Discovering That Your Linux Box is Hacked
Anton Chuvakin on Discovering That Your Linux Box is HackedAnton Chuvakin on Discovering That Your Linux Box is Hacked
Anton Chuvakin on Discovering That Your Linux Box is Hacked
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

Windows Threat Hunting

  • 1. Windows Threat Hunting Null Dubai 2016 GIBIN JOHN
  • 2. Incident Triage Triaging an incident defines the success of incident response. The latest attacker tools and techniques are increasingly stealthy and happens in multiple stages, which makes traditional AVs helpless. Identifying key indicators and finding the artifacts will decide how effectively you can do incident triage. Some key questions triaging should address are: Identifying potential malwares Identifying the mode of Infection Identifying how they lateral movements Identifying Privilage Escalation and Persistence Mechanism And what was it trying to accomplish?
  • 3. Many things to look at…. •Processes •Network connections and listening ports •Filesystem •Logs • Autoruns • Prefetch •Scheduled Tasks (At jobs) •LNKs •ShimCache • AmCache • RecentFileCache • Recycler • HIVEs • ldrmodules / dlllist • BIOS • MBR •Rogue Services • Volatile/RAW memory • MFT Etc…
  • 4. General Hunting Scenarios - Hunting with intelligence ◦ Consume threat intelligence ◦ Yarascan for know malwares, web shells and other indicators. ◦ Search based on Intel's – IOC (Open-IOC, STIX, Hash, TTP, Filenames etc..) ◦ Network and host based indicators. - Hunting with zero intelligence ◦ Collect specific data from all your hosts. ◦ Look for anomalies and outliers ◦ Network and host forensics.
  • 5. Windows Task Scheduler  Schedules commands and programs to run periodically or at a specific time. Task can be scheduled using ‘schtasks.exe’, ‘task scheduler’, ‘at.exe’  A persistence method which can possibly do privilege escalation/lateral movement ◦ Location: ◦ C:WindowsTasks (XP - Windows Job Format) ◦ C:WindowsSystem32Tasks (Win7+ - XML) ◦ C:WindowsSysWow64Tasks (Win7+ - XML) ◦ C:> schtasks ◦ Files for triage - ◦ C:WindowsTasksSchedlgu.txt ◦ C:WindowsTasksAt*.job ◦ C:WindowsSystem32winevtLogsMicrosoft-Windows-TaskScheduler* Legitimate Windows file rundll32.exe has been scheduled as a job to load a malicious DLL with export function “Afght”
  • 6. ShimCache PARSER- https://github.com/mandiant/ShimCacheParser/blob/master/ShimC acheParser.py o Windows Application Compatibility Database – Used by operating system to identify application compatibility issues o Good source for while investigating lateral movement Records - File Full Path, File Size, $Standard_Information (SI) Last Modified time, Shimcache Last Updated time, Process Execution Flag Location: HKLMSYSTEMCurrentControlSetControlSession Manager AppCompactCache|AppCompatibilityAppCompatCache
  • 7. Cont.. Indicators to start with > Keep and eye on - ◦ Directories like system32, %temp% , %Windows%, Recycle, %AppData% Web root Directories - Inetpub, wwwroot, etc.. ◦ Reserved file names and its location. ◦ Binaries with less than 1000 bytes in size. ◦ Single, double and triple character file names. ◦ Files with suspicious extensions (rar, tmp, tar, dat, etc..). ◦ Hidden files, batch files, scripts, *.job, at*.job etc.. ◦ Search based on specific date and time. ◦ Search based on suspicious file names (svch0st.exe, scvhost.exe, expl0ree.exe etc) Etc..
  • 8. AmCache & RecentFileCache AmCache Helpful in identifying recently executed application. • C:WindowsAppCompatProgramsAmcache.hve) RecentFileCache Useful in identifying evidence of suspicious process creation C:WindowsAppCompatProgramsRecentFileCache.bcf
  • 9. Rogue Services • A service is a program that is automatically started by Windows NT/XP/2000/2003 on startup or through some other means and is generally used for programs that run in the background. • Service can be loaded on start-up either by – ◦ Windows directly – File that launches the service can be found in HKEY_LOCAL_MACHINESYSTEM CurrentControlSetServicesservicename • Using svchost.exe HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionSvchost
  • 10. Demo.. • A simple bat script to install a backdoor as a service using svshost.exe .. Tools – SysInternals Suite (PsService.exe etc..) http://www.bleepingcomputer.com/download/getservices/
  • 11. Common Indicators to detect Rogue Services >  Look for suspicious services registry entry (eg- Registry access denied message on HIPS @ImagePath Or @ServiceDll entry )  Error Control Set = 0 (User will not get service fails erroe during startup.)  Services running from program data.  Autorun enabled on unsigned ServiceDLL.  Auto Start (Type 2) services with suspicious names ..
  • 12. Timeline Analysis using MFT  MFT analysis is helpful to identify if any additional tools were dropped on the system and also other artefacts left due to the execution of the malware.  NTFS has 8 timestamps  Standard Information Attribute ($SI)  Filename Information Attribute ($FN) - They are not exposed to user space.  Both $SI and $FN has 4 time stamps (crtime, mtime, atime and MFT Entry Modified)  Worth checking if you identified a files that are time stomped.  TimeStomp module in msf https://www.offensive-security.com/metasploit-unleashed/timestomp/
  • 13. DLL Side Loading  A popular cyber attack method that takes advantage of how Microsoft Windows applications handle DLL files.  When an exe is loading the windows loader will parse the IAT and load it by checking the following registry key (A list of Known windows dlls) - HKEY_LOCAL_MACHINESystemCurrentControlSetControlSession ManagerKnownDLLs ◦ And if any dll being imported is not in the list of knowndll, it will search on the current directory of the executable module. Attackers can take advantage of this and can load a malicious on a genuine executable. Possible Indicators –  Unsigned dll loaded in process, Autorun, Services running from suspicious location, Unknown DLL import
  • 14. DLL injection – User Mode Rootkits [Demo] • Identifying the DLLs loaded by a process at runtime is a vaulbe information, as it is a common technique used by rootkits – “Dll Injection”. Unsigned creates remote thread
  • 15. Autorun Where are the autoruns? •Registry run keys •Services •Drivers •Browser add-ons ……
  • 16. Wdigest downgrade • One common attack vector that has been around for several years is to use a tool called Mimikatz and steal cleartext credentials from memory of compromised Windows systems. • Newer versions such as Windows 8 / 10 and Windows Server 2012 / 2016 introduced a registry setting that disables storage of clear-text for credentials the WDigest provider by default. If the value of UseLogonCredentialvalue is set to “1”, WDigestwill store credentials in clear text in memory and might be an indication attempt of password dumping. HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersWDigestUseLog onCredential • KB2871997 “back-ports” the registry setting to Windows 7, 8, Server 2008R2 and 2012.