SlideShare a Scribd company logo
Session ID:
Session Classification:
Tomer Teller
Check Point SoftwareTechnologies
SP02-T19
Intermediate
Detectingthe One Percent:
AdvancedTargetedMalware Detection
Antivirus 20th+ Anniversary
Spo2 t19 spo2-t19
The Halting Problem
The Malware Problem
Spo2 t19 spo2-t19
The Constraints
TIME
Cannot analyze program forever
• Slow down loops
• Sleep
• Time-consuming operations (Encryption/Packing)
SPACE
Cannot maintain unlimited states
• “Run out the clock”
OpenProcess  VirtualAllocEx 
WriteProcessMemory  LOOP  .. 
CreateRemoteThread
Exploiting the Constraints
Advanced malware exploits these constraints
Thwart static analysis --> SPACE
Thwart dynamic analysis --> TIME + SPACE
► Elevation of privilege to kernel mode
► Bypassing security products
► Stolen certificate authorities
► Breaking the trust
► Automatic static analysis is hard!
► Packing / obfuscation / encryption
► Manual static analysis
► Unpacking / time consuming / not scalable
► Dynamic analysis
► The malware problem!
More Depressing News
Relax!
Pattern Based Static Analysis
Dynamic Analysis Hybrid Approach
Current Detection Methods (partial)
• MD5 / SHA1 / SHA256
• Fuzzy hashing
• Pattern-based
• PCRE/ Regex
• Proprietary language
• Malware classifiers (J48, J48
Graft, PART)
• Anti-VM
• Anti-debugging
• Anti-disassembly
• Obfuscation
• Reverse engineering
**Rodrigo Rubira Branco BH12
• API call trace analysis
• Network activities
• Registry modifications
• Process creation/injections
• File activities
What you see is what you get!
• Semantic-aware detectors
• Extract dynamic trace
• Transform into IR
• Compare to pre-defined
templates
• Memory dump analysis
(packers)
The Sample Lifecycle
Sample Arrives Unknown
Static
Analysis
# Flags
< Threshold Dynamic
Analysis
Classification
Benign
Not Classified
Generic
Threat
Family
Threat
Classified
Manual
Analysis
Malicious
Interesting
# Flags
< Threshold
Bypassing Detection Methods
Pattern Based Static Analysis
Dynamic Analysis Hybrid Approach
• Build variants (e.g. Zeus)
• Append garbage
• Encoding
• “Stay compliant”
• Packing
• Obfuscation
• Encryption
• Anti-reversing techniques
• Detect analysis*
• Detect emulation*
• Detect security product*
• Beat the clock (AV sandbox)
• “Split the maliciousness”
*Could be detected during static analysis
• Avoid using the same
executable template
• Metasploit AV-evasion
• Reuse “trusted templates”
• PowerShell
• In-memory exploits
MYTH #1
Malware executes immediately
Spo2 t19 spo2-t19
MYTH #2
Malware is usually small
Spo2 t19 spo2-t19
*Size in MB
Malware Detection Based on File Size
Ref: http://www.fortiguard.com/sites/default/files/DetectingMalwareThreats.pdf
Malware Bypassing Detections
Static Analysis Dynamic Analysis
4 x Zero-Days Obfuscated Entry Point (Needs a
special Loader)
2 x Stolen Certificates (Break the
trust)
Multiple Files (lesser maliciousness
entropy)
Unknown DLL loading technique Execution depends on host
Static Analysis Dynamic Analysis
20 MB of Code! Does not execute immediately
Breakthrough in cryptography
(Break the trust)
Multiple Files (lesser maliciousness
entropy)
Legitimate Libraries (LUA) Obfuscated Entry Point (Needs a
special Loader)
Stuxnet
Flame
MalwareThwarting Analysis
Mac OSX C&C
Infected
with
FlashFake
Send Hardware UUID (Unique)
Exploit Java Vulnerability
Encrypted Malware
Executable will only run
on the original host
UUID
Encryption Key
Encrypt
Malware and
Obfuscate
Problem
Detection is good but not great
Data-Structure Modifications
Problem:
Malware modifies internal
data-structures to avoid
detection
Solution:
Subvert the malware!
Modify the data-structure
before the malware does
Detecting Internal DS Modifications
push ebp
mov ebp,esp
push ebx
push esi
.
.
<Internal DS>
.
.
TRAP PAGE
F F Clone
push ebp
mov ebp,esp
push ebx
push esi
.
.
<Internal DS>
.
.
jmp F_clone
.
.
<Internal DS>
.
.
Normal ExecutionMalware Execution
Detected
Internal DS
Linear search for a
signature
PsSetCreateProcessNotifyRoutine
PAGE
Guard
Example::PsSetCreateProcessNotifyRoutine
Original
Clone
► Detect function hooking tempering
► Hook a function and monitor the hook
► Protect the monitor routine
► Detection of linear memory scanning
► Staged attacks
► Egg hunt
► Detection of internal data-structure manipulation
► Basic DKOM Detection
► Place calls to Page Guard in strategic places
► Detect Heap Spraying (“canary”value)
Technique Usage
Process Enumeration
Problem:
Malware checks for the
existence of a security
product process
Solution:
Process enumeration using
weight based mechanism
taint analysis
► Monitor EPROCESS structure access
► Track process name usage (taint analysis)
► Score the process based on“weird”usage
► HASH
► Encryption
► Encoding
► Etc.
Detecting“weird”Process Enumerations
Obfuscation!
Problem:
Malware uses obfuscation to
hide malicious code during
Drive-by-download attacks
Solution:
Hook the browser at
strategic places and inspect
the de-obfuscated buffers
► Obfuscation is a problem!
► Network devices are blind
► Possible solution on the network side
► Analyze data entropy to detect possible obfuscation
► Google uses obfuscation -> massive FP
► Better solution on the end point
► Hook the browsers (IE/Chrome/Firefox) at strategic places
► Eval, Document.write, innerhtml, etc’
► Let the browser do the“heavy lifting”
► Communicate the information back to the network devices
TappingThe Browser
DEMO: BrowserTapper
Anti-VM OUT, Anti-Analysis IN
Problem:
Malware drop anti-VM
technique and focus on anti-
Analysis techniques
Solution:
Subvert the analysis machine
with a Rootkit before
executing the malware
► Malware usually cannot detect Rootkit!
► Install a rootkit on the analysis machine
► Hide files/processes/drivers
► Hide open ports
► Hide registry values
► Malware is not aware that it is being subverted
► Results in higher detection rate of advanced malware
Subvert the Analysis Machine
► Easy-to-use rootkit generator
► Choose the process/files/ports/registry values
you wish to hide
► Generates a customize rootkit
► Install rootkit
► Benefit!
DEMO:Tool-B-Gone
► Detecting internal threats using ML
► Most network behavior analysis tools fail to deliver
► Bad feature sets that results in massive FP
► Feature set focus on user behavioral profile and not malware
► Data entropy / Working hours / Keyboard typing speed’
► Based on the protoleak project (RSA 12’)
► Profile-based decision tree per node
► Focus on data exfiltration and behavior deviations
► Malware Interaction
► Click/Move Mouse
► Open Applications
FutureDirections
► Force malware mistakes, don’t wait for them to strike
► Raise attackers cost by innovating mitigations
► Download & try the tools
► Help fighting the 1% and suggest improvements
How to Apply
Questions
ThankYou
@djteller

More Related Content

PPTX
Basic Malware Analysis
PPTX
Malware analysis
PPTX
Basic Dynamic Analysis of Malware
PDF
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
PDF
Fantastic Red Team Attacks and How to Find Them
PDF
Malware classification and detection
PDF
The Hunter Games: How to Find the Adversary with Event Query Language
PPTX
Malware Analysis 101 - N00b to Ninja in 60 Minutes at BSidesLV on August 5, ...
Basic Malware Analysis
Malware analysis
Basic Dynamic Analysis of Malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Fantastic Red Team Attacks and How to Find Them
Malware classification and detection
The Hunter Games: How to Find the Adversary with Event Query Language
Malware Analysis 101 - N00b to Ninja in 60 Minutes at BSidesLV on August 5, ...

What's hot (19)

PDF
Fileless Malware Infections
PDF
Lateral Movement: How attackers quietly traverse your Network
PDF
CNIT 152: 1 Real-World Incidents
PPT
Analysis Of Adverarial Code - The Role of Malware Kits
PPTX
Sticky Keys to the Kingdom
PDF
Automatic tool for static analysis
PPT
Malware Analysis Made Simple
PPTX
Exploitation techniques and fuzzing
PPTX
Revealing the Attack Operations Targeting Japan by Shusei Tomonaga & Yuu Nak...
PPT
The Future of Automated Malware Generation
PDF
CNIT 152: 6. Scope & 7. Live Data Collection
PPTX
Lateral Movement - Phreaknik 2016
PPT
Malware Classification Using Structured Control Flow
PDF
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
PDF
CNIT 126 11. Malware Behavior
PPTX
Malicious Client Detection Using Machine Learning
PDF
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
PPTX
Virtual Machine Introspection - Future of the Cloud
PDF
BlueHat v18 || Protecting the protector, hardening machine learning defenses ...
Fileless Malware Infections
Lateral Movement: How attackers quietly traverse your Network
CNIT 152: 1 Real-World Incidents
Analysis Of Adverarial Code - The Role of Malware Kits
Sticky Keys to the Kingdom
Automatic tool for static analysis
Malware Analysis Made Simple
Exploitation techniques and fuzzing
Revealing the Attack Operations Targeting Japan by Shusei Tomonaga & Yuu Nak...
The Future of Automated Malware Generation
CNIT 152: 6. Scope & 7. Live Data Collection
Lateral Movement - Phreaknik 2016
Malware Classification Using Structured Control Flow
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
CNIT 126 11. Malware Behavior
Malicious Client Detection Using Machine Learning
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
Virtual Machine Introspection - Future of the Cloud
BlueHat v18 || Protecting the protector, hardening machine learning defenses ...
Ad

Viewers also liked (20)

PDF
Applying Anti-Reversing Techniques to Machine Code
PPT
Intrusion detection and prevention
PDF
Desofuscando um webshell em php h2hc Ed.9
PDF
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
PDF
(130216) #fitalk potentially malicious ur ls
PDF
Generic attack detection engine
PPT
Applciation footprinting, discovery and enumeration
PDF
Obfuscation, Golfing and Secret Operators in Perl
PDF
EvasionTechniques
PPTX
Back to the CORE
PPTX
Attack on the Core
PDF
CSIRT_16_Jun
PPTX
TakeDownCon Rocket City: WebShells by Adrian Crenshaw
PPTX
Endpoint Security Evasion
PDF
Deobfuscation and beyond (ZeroNights, 2014)
PPT
Top Tactics For Endpoint Security
PPTX
An Introduction of SQL Injection, Buffer Overflow & Wireless Attack
PDF
Got database access? Own the network!
PPTX
Roadsec 2016 Mach-o A New Threat
PPTX
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Applying Anti-Reversing Techniques to Machine Code
Intrusion detection and prevention
Desofuscando um webshell em php h2hc Ed.9
Binary Obfuscation from the Top Down: Obfuscation Executables without Writing...
(130216) #fitalk potentially malicious ur ls
Generic attack detection engine
Applciation footprinting, discovery and enumeration
Obfuscation, Golfing and Secret Operators in Perl
EvasionTechniques
Back to the CORE
Attack on the Core
CSIRT_16_Jun
TakeDownCon Rocket City: WebShells by Adrian Crenshaw
Endpoint Security Evasion
Deobfuscation and beyond (ZeroNights, 2014)
Top Tactics For Endpoint Security
An Introduction of SQL Injection, Buffer Overflow & Wireless Attack
Got database access? Own the network!
Roadsec 2016 Mach-o A New Threat
Windows Kernel Exploitation : This Time Font hunt you down in 4 bytes
Ad

Similar to Spo2 t19 spo2-t19 (20)

PPTX
CheckPoint: Anatomy of an evolving bot
PPTX
Understand How Machine Learning Defends Against Zero-Day Threats
PPTX
Understand How Machine Learning Defends Against Zero-Day Threats
PPTX
Building next gen malware behavioural analysis environment
PDF
CH1- Introduction to malware analysis-v2.pdf
PPTX
Malware analysis as a hobby (Owasp Göteborg)
PPT
Active Testing
PDF
Cyber Defense Forensic Analyst - Real World Hands-on Examples
PPTX
Basic malware analysis
PDF
Hunting malware via memory forensics
PPTX
Basic malware analysis
PDF
CheckPlease: Payload-Agnostic Targeted Malware
PPTX
Reversing malware analysis trainingpart9 advanced malware analysis
PDF
Automated In-memory Malware/Rootkit Detection via Binary Analysis and Machin...
PPTX
Countering Innovative Sandbox Evasion Techniques Used by Malware
PDF
Malware Analysis on a Shoestring Budget
PDF
Analisis Estatico y de Comportamiento de un Binario Malicioso
PDF
Malware Evasion Techniques
PDF
Modern Malware and Threats
PPTX
Malware Analysis as a Hobby - 44CON 2012
CheckPoint: Anatomy of an evolving bot
Understand How Machine Learning Defends Against Zero-Day Threats
Understand How Machine Learning Defends Against Zero-Day Threats
Building next gen malware behavioural analysis environment
CH1- Introduction to malware analysis-v2.pdf
Malware analysis as a hobby (Owasp Göteborg)
Active Testing
Cyber Defense Forensic Analyst - Real World Hands-on Examples
Basic malware analysis
Hunting malware via memory forensics
Basic malware analysis
CheckPlease: Payload-Agnostic Targeted Malware
Reversing malware analysis trainingpart9 advanced malware analysis
Automated In-memory Malware/Rootkit Detection via Binary Analysis and Machin...
Countering Innovative Sandbox Evasion Techniques Used by Malware
Malware Analysis on a Shoestring Budget
Analisis Estatico y de Comportamiento de un Binario Malicioso
Malware Evasion Techniques
Modern Malware and Threats
Malware Analysis as a Hobby - 44CON 2012

More from SelectedPresentations (20)

PDF
Длительное архивное хранение ЭД: правовые аспекты и технологические решения
PDF
Трансграничное пространство доверия. Доверенная третья сторона.
PDF
Варианты реализации атак через мобильные устройства
PDF
Новые технологические возможности и безопасность мобильных решений
PDF
Управление безопасностью мобильных устройств
PDF
Современные технологии контроля и защиты мобильных устройств, тенденции рынка...
PDF
Кадровое агентство отрасли информационной безопасности
PDF
Основное содержание профессионального стандарта «Специалист по безопасности и...
PDF
Основное содержание профессионального стандарта «Специалист по безопасности а...
PDF
Основное содержание профессионального стандарта «Специалист по технической за...
PDF
Основное содержание профессионального стандарта «Специалист по безопасности т...
PDF
О профессиональных стандартах по группе занятий (профессий) «Специалисты в об...
PDF
Запись активности пользователей с интеллектуальным анализом данных
PDF
Импортозамещение в системах ИБ банков. Практические аспекты перехода на росси...
PDF
Обеспечение защиты информации на стадиях жизненного цикла ИС
PDF
Документ, как средство защиты: ОРД как основа обеспечения ИБ
PDF
Чего не хватает в современных ids для защиты банковских приложений
PDF
Об участии МОО «АЗИ» в разработке профессиональных стандартов в области инфор...
PDF
Оценка состояния, меры формирования индустрии информационной безопасности Рос...
PDF
Об угрозах информационной безопасности, актуальных для разработчика СЗИ
Длительное архивное хранение ЭД: правовые аспекты и технологические решения
Трансграничное пространство доверия. Доверенная третья сторона.
Варианты реализации атак через мобильные устройства
Новые технологические возможности и безопасность мобильных решений
Управление безопасностью мобильных устройств
Современные технологии контроля и защиты мобильных устройств, тенденции рынка...
Кадровое агентство отрасли информационной безопасности
Основное содержание профессионального стандарта «Специалист по безопасности и...
Основное содержание профессионального стандарта «Специалист по безопасности а...
Основное содержание профессионального стандарта «Специалист по технической за...
Основное содержание профессионального стандарта «Специалист по безопасности т...
О профессиональных стандартах по группе занятий (профессий) «Специалисты в об...
Запись активности пользователей с интеллектуальным анализом данных
Импортозамещение в системах ИБ банков. Практические аспекты перехода на росси...
Обеспечение защиты информации на стадиях жизненного цикла ИС
Документ, как средство защиты: ОРД как основа обеспечения ИБ
Чего не хватает в современных ids для защиты банковских приложений
Об участии МОО «АЗИ» в разработке профессиональных стандартов в области инфор...
Оценка состояния, меры формирования индустрии информационной безопасности Рос...
Об угрозах информационной безопасности, актуальных для разработчика СЗИ

Spo2 t19 spo2-t19

  • 1. Session ID: Session Classification: Tomer Teller Check Point SoftwareTechnologies SP02-T19 Intermediate Detectingthe One Percent: AdvancedTargetedMalware Detection
  • 7. The Constraints TIME Cannot analyze program forever • Slow down loops • Sleep • Time-consuming operations (Encryption/Packing) SPACE Cannot maintain unlimited states • “Run out the clock” OpenProcess  VirtualAllocEx  WriteProcessMemory  LOOP  ..  CreateRemoteThread
  • 8. Exploiting the Constraints Advanced malware exploits these constraints Thwart static analysis --> SPACE Thwart dynamic analysis --> TIME + SPACE
  • 9. ► Elevation of privilege to kernel mode ► Bypassing security products ► Stolen certificate authorities ► Breaking the trust ► Automatic static analysis is hard! ► Packing / obfuscation / encryption ► Manual static analysis ► Unpacking / time consuming / not scalable ► Dynamic analysis ► The malware problem! More Depressing News
  • 11. Pattern Based Static Analysis Dynamic Analysis Hybrid Approach Current Detection Methods (partial) • MD5 / SHA1 / SHA256 • Fuzzy hashing • Pattern-based • PCRE/ Regex • Proprietary language • Malware classifiers (J48, J48 Graft, PART) • Anti-VM • Anti-debugging • Anti-disassembly • Obfuscation • Reverse engineering **Rodrigo Rubira Branco BH12 • API call trace analysis • Network activities • Registry modifications • Process creation/injections • File activities What you see is what you get! • Semantic-aware detectors • Extract dynamic trace • Transform into IR • Compare to pre-defined templates • Memory dump analysis (packers)
  • 12. The Sample Lifecycle Sample Arrives Unknown Static Analysis # Flags < Threshold Dynamic Analysis Classification Benign Not Classified Generic Threat Family Threat Classified Manual Analysis Malicious Interesting # Flags < Threshold
  • 13. Bypassing Detection Methods Pattern Based Static Analysis Dynamic Analysis Hybrid Approach • Build variants (e.g. Zeus) • Append garbage • Encoding • “Stay compliant” • Packing • Obfuscation • Encryption • Anti-reversing techniques • Detect analysis* • Detect emulation* • Detect security product* • Beat the clock (AV sandbox) • “Split the maliciousness” *Could be detected during static analysis • Avoid using the same executable template • Metasploit AV-evasion • Reuse “trusted templates” • PowerShell • In-memory exploits
  • 16. MYTH #2 Malware is usually small
  • 18. *Size in MB Malware Detection Based on File Size Ref: http://www.fortiguard.com/sites/default/files/DetectingMalwareThreats.pdf
  • 19. Malware Bypassing Detections Static Analysis Dynamic Analysis 4 x Zero-Days Obfuscated Entry Point (Needs a special Loader) 2 x Stolen Certificates (Break the trust) Multiple Files (lesser maliciousness entropy) Unknown DLL loading technique Execution depends on host Static Analysis Dynamic Analysis 20 MB of Code! Does not execute immediately Breakthrough in cryptography (Break the trust) Multiple Files (lesser maliciousness entropy) Legitimate Libraries (LUA) Obfuscated Entry Point (Needs a special Loader) Stuxnet Flame
  • 20. MalwareThwarting Analysis Mac OSX C&C Infected with FlashFake Send Hardware UUID (Unique) Exploit Java Vulnerability Encrypted Malware Executable will only run on the original host UUID Encryption Key Encrypt Malware and Obfuscate
  • 21. Problem Detection is good but not great
  • 22. Data-Structure Modifications Problem: Malware modifies internal data-structures to avoid detection Solution: Subvert the malware! Modify the data-structure before the malware does
  • 23. Detecting Internal DS Modifications push ebp mov ebp,esp push ebx push esi . . <Internal DS> . . TRAP PAGE F F Clone push ebp mov ebp,esp push ebx push esi . . <Internal DS> . . jmp F_clone . . <Internal DS> . . Normal ExecutionMalware Execution Detected
  • 24. Internal DS Linear search for a signature PsSetCreateProcessNotifyRoutine
  • 26. ► Detect function hooking tempering ► Hook a function and monitor the hook ► Protect the monitor routine ► Detection of linear memory scanning ► Staged attacks ► Egg hunt ► Detection of internal data-structure manipulation ► Basic DKOM Detection ► Place calls to Page Guard in strategic places ► Detect Heap Spraying (“canary”value) Technique Usage
  • 27. Process Enumeration Problem: Malware checks for the existence of a security product process Solution: Process enumeration using weight based mechanism taint analysis
  • 28. ► Monitor EPROCESS structure access ► Track process name usage (taint analysis) ► Score the process based on“weird”usage ► HASH ► Encryption ► Encoding ► Etc. Detecting“weird”Process Enumerations
  • 29. Obfuscation! Problem: Malware uses obfuscation to hide malicious code during Drive-by-download attacks Solution: Hook the browser at strategic places and inspect the de-obfuscated buffers
  • 30. ► Obfuscation is a problem! ► Network devices are blind ► Possible solution on the network side ► Analyze data entropy to detect possible obfuscation ► Google uses obfuscation -> massive FP ► Better solution on the end point ► Hook the browsers (IE/Chrome/Firefox) at strategic places ► Eval, Document.write, innerhtml, etc’ ► Let the browser do the“heavy lifting” ► Communicate the information back to the network devices TappingThe Browser
  • 32. Anti-VM OUT, Anti-Analysis IN Problem: Malware drop anti-VM technique and focus on anti- Analysis techniques Solution: Subvert the analysis machine with a Rootkit before executing the malware
  • 33. ► Malware usually cannot detect Rootkit! ► Install a rootkit on the analysis machine ► Hide files/processes/drivers ► Hide open ports ► Hide registry values ► Malware is not aware that it is being subverted ► Results in higher detection rate of advanced malware Subvert the Analysis Machine
  • 34. ► Easy-to-use rootkit generator ► Choose the process/files/ports/registry values you wish to hide ► Generates a customize rootkit ► Install rootkit ► Benefit! DEMO:Tool-B-Gone
  • 35. ► Detecting internal threats using ML ► Most network behavior analysis tools fail to deliver ► Bad feature sets that results in massive FP ► Feature set focus on user behavioral profile and not malware ► Data entropy / Working hours / Keyboard typing speed’ ► Based on the protoleak project (RSA 12’) ► Profile-based decision tree per node ► Focus on data exfiltration and behavior deviations ► Malware Interaction ► Click/Move Mouse ► Open Applications FutureDirections
  • 36. ► Force malware mistakes, don’t wait for them to strike ► Raise attackers cost by innovating mitigations ► Download & try the tools ► Help fighting the 1% and suggest improvements How to Apply