SlideShare a Scribd company logo
1 of 59
Download to read offline
Tricky Sample ? Hack it easy! Applying dynamic binary
instrumentation to light-weight malware behavior analysis
Maksim Shudrak
About Me
BIO
2018 – present: Senior Offensive Security Researcher
2016: Defended PhD (Vulns Hunting) in Tomsk, Russia
2015-2017: Researcher, IBM Research, Haifa, Israel
2011-2015: Security Researcher, PhD student
Interests
Vulnerabilities Hunting
Fuzzing
Reverse-engineering
Malware Analysis
Dynamic Binary Instrumentation
Projects
Drltrace – transparent API-calls tracing for malware analysis
https://github.com/mxmssh/drltrace
WinHeap Explorer – PoC for heap-based bugs detection in x86 code
https://github.com/WinHeapExplorer/WinHeap-Explorer
IDAMetrics – IDA plugin for machine code complexity assessment
https://github.com/mxmssh/IDAmetrics
Outline
● Why Dynamic Analysis?
● Current approaches
● Runtime Overhead vs Visibility
● Dynamic Binary Instrumentation
● Technique Overview
● DBI Frameworks Comparison
● DrLtrace
● How Does It Work ?
● Usage
● Examples & Demo
3
Why dynamic ?
● Obfuscated & packed
code hard for
static analysis.
● In some cases, we
need only a high-
level view on
malware behavior.
4
Current Situation in Dynamic Analysis
Runtime overhead
Visibility
Library Calls Tracing
(e.g. APIMonitor)
Emulation
(e.g. QEMU+PANDA)
Syscalls Tracing
(e.g. ProcMon)
5
Emulation. Visibility Example
6
Runtime Overhead. Stalling Code
7
10 min on CPU = 1d08h in emulator
8
Emulation. Visibility Example
9
Syscalls Tracing. Visibility Example
10
API Tracing. Visibility Example
11
Ltrace for Linux
12
Current Situationin Dynamic Analysis
Runtime overhead
Visibility
Library Calls Tracing
(e.g. APIMonitor)
Emulation
(e.g. QEMU+PANDA)
Syscalls Tracing
(e.g. ProcMon)
?
13
Current Situationin Dynamic Analysis
Runtime overhead
Visibility
Library Calls Tracing
(e.g. APIMonitor)
Emulation
(e.g. QEMU+PANDA)
Syscalls Tracing
(e.g. ProcMon)
Dynamic Binary Instrumentation
(e.g. Intel Pin)
14
Dynamic Binary Instrumentation (DBI) is a
technique of analyzing the behavior of a binary
application at runtime through the injection of
instrumentation code.
15
Modern DBI Frameworks
DynamoRIO Intel PIN
Redistribution
model
Open-source, BSD – license Proprietary
Supported
architectures
x86, x86-64, ARM, AArch64 x86, x86-64
Supported
Platforms
Linux, Windows, MacOS,
Android
Linux, Windows, MacOS,
Android
Average
runtime overhead
108% (no tool)
139% (BBs counter)
130% (no tool)
162% (BBs counter)
Language C/C++ C/C++ (some Python
wrappers available)
Technology Binary code transformation callout/trampolines
16
How Does DynamoRIO Work ? (10000 foot view)
Target applicationLauncher
DynamoRIO Application in memory
Kernel
shared system libs
17
How Does DynamoRIO Work ? (10000 foot view)
Target applicationLauncher
DynamoRIO
Launch (suspended)
(1)
Application in memory
Kernel
shared system libs
.
.
18
How Does DynamoRIO Work ? (10000 foot view)
Launcher
DynamoRIO
Launch (suspended)
(1)
Application in memory
Kernel
(2)
Inject instrumentation
library
Target application
shared system libs
19
Target application
shared system libs
How Does DynamoRIO Work ? (10000 foot view)
Launcher
DynamoRIO
Launch (suspended)
(1)
Application in memory
Kernel
(3)
Hook entry point DynamoRIO lib + user-defined libs
20
Target application
shared system libs
How Does DynamoRIO Work ? (10000 foot view)
Launcher
DynamoRIO
Launch (suspended)
(1)
Application in memory
Kernel
(3)
Hook entry point DynamoRIO lib + user-defined libs
ins2
basic block
ins3
ins1
Takefirstbasicblock
(4)
21
Target application
shared system libs
How Does DynamoRIO Work ? (10000 foot view)
Launcher
DynamoRIO
Launch (suspended)
(1)
Application in memory
Kernel
(3)
Hook entry point DynamoRIO lib + user-defined libs
ins2
basic block
transformation
(5)
ins1
ins2
DR’s ins6
ins3
ins1
Code cache
DR’s ins1
DR’s ins2
DR’s ins3
DR’s ins4
DR’s ins5
ins3
(4)
Takefirstbasicblock
22
Target application
shared system libs
How Does DynamoRIO Work ? (10000 foot view)
Launcher
DynamoRIO
Launch (suspended)
(1)
Application in memory
Kernel
(3)
Hook entry point DynamoRIO lib + user-defined libs
Takefirstbasicblock
(4)
ins2
basic block
transformation
(5)
ins1
ins2
DR’s ins6
ins3
ins1
Code cache
DR’s ins1
DR’s ins2
DR’s ins3
DR’s ins4
DR’s ins5
ins3
Takenextbasicblock
(6)
23
How Does Drltrace Work ?
Application in memory
Main module
kernel32.dll
ntdll.dll
DBI engine
dynamorio.dll
drltrace.dll
24
How Does Drltrace Work ?
Application in memory
Main module
kernel32.dll
ntdll.dll
DBI engine
dynamorio.dll
drltrace.dll
25
InstrumentLoadLibrarycall
Setcallback
(1)
(1.1)
How Does Drltrace Work ?
Application in memory
Main module
kernel32.dll
ntdll.dll
DBI engine
dynamorio.dll
drltrace.dll
26
InstrumentLoadLibrarycall
Setcallback
(1)
(1.1)
LoadLibrary(msvcrt.dll)(2)
How Does Drltrace Work ?
Application in memory
Main module
kernel32.dll
ntdll.dll
DBI engine
dynamorio.dll
drltrace.dll
27
InstrumentLoadLibrarycall
Setcallback
(1)
(1.1)
LoadLibrary(msvcrt.dll)(2)
msvcrt.dll (being loaded)
Instrumentexportedfunctions
(3)
DynamoRIO and Drltracelib in The Memory of Calculator
28
Usage
drltrace.exe –logdir . – malware.exe
Why DrLtrace Rock
● Support x86 and x64 (ARM in future).
30
Why DrLtrace Rock
● Support x86 and x64 (ARM in future).
● Support Windows and Linux (macOS in future).
31
Why DrLtrace Rock
● Support x86 and x64 (ARM in future).
● Support Windows and Linux (macOS in future).
● Support self-modifying code.
32
Why DrLtrace Rock
● Support x86 and x64 (ARM in future).
● Support Windows and Linux (macOS in future).
● Support self-modifying code.
● Support all types of library API calls (static and
dynamic).
33
Why DrLtrace Rock
● Support x86 and x64 (ARM in future).
● Support Windows and Linux (macOS in future).
● Support self-modifying code.
● Support all types of library API calls (static and
dynamic).
● Not-detectable by standard malware anti-research
techniques (anti-hooking, anti-debugging and anti-
emulation).
34
Why DrLtrace Rock
● Support x86 and x64 (ARM in future).
● Support Windows and Linux (macOS in future).
● Support self-modifying code.
● Support all types of library API calls (static and
dynamic).
● Not-detectable by standard malware anti-research
techniques (anti-hooking, anti-debugging and anti-
emulation).
● External configuration file to add new API calls.
35
Why DrLtrace Rock
● Support x86 and x64 (ARM in future).
● Support Windows and Linux (macOS in future).
● Support self-modifying code.
● Support all types of library API calls (static and
dynamic).
● Not-detectable by standard malware anti-research
techniques (anti-hooking, anti-debugging and anti-
emulation).
● External configuration file to add new API calls.
● Easy-to-use (no additional dependencies, no heavy-
weight GUI).
36
Why DrLtrace Rock
● Support x86 and x64 (ARM in future).
● Support Windows and Linux (macOS in future).
● Support self-modifying code.
● Support all types of library API calls (static and
dynamic).
● Not-detectable by standard malware anti-research
techniques (anti-hooking, anti-debugging and anti-
emulation).
● External configuration file to add new API calls.
● Easy-to-use (no additional dependencies, no heavy-
weight GUI).
● Open-source (BSD-license).
37
Runtime Overhead
PowerPoint Word Calculator Internet Explorer VMWare IDA PRO StarCraft II
Launcher
Dropbox Chrome Notepad++ 38
14,7
16,5
20,2
37,2
10
22
44,6
25,6
43,3
32
0
5
10
15
20
25
30
35
40
45
50
RUNTIMEOVERHEAD
Example 1. EmbusteBot
● Type - Brazilian BankingTrojan
● Language - Delphi
● Main Functionality – Keylogger,Screenshotscapturing
● Obfuscation – time-based anti-researchchecks,encryptionof sensitivestrings,no code packing
● Operation period – (2017 – present)
Report- https://securityintelligence.com/brazilian-malware-never-sleeps-meet-embustebot/
More details - https://github.com/mxmssh/drltrace/wiki/Malware-Analysis-Examples
39
Example 1. EmbusteBot
drltrace.exe -logdir . -print_ret_addr – vdeis.exe
40
Example I. EmbusteBot. Searching for Tab with Bank Name
41
Example I. EmbusteBot. Screenshots Capturing and Keylogging API Calls
42
Example I. EmbusteBot. Trigger
43
Example II. Gootkit Loader
● Type : Banking Trojan
● Language : C
● Main Functionality:Unpack actual payload loader, deliver Gootkit malware on victim’s machine
● Obfuscation: anti-VM, anti-debugging, anti-emulation,time-based anti-research, packed payload, machine-
code obfuscation, anti-sandboxing.
● Operation period: (2014 – present)
Technical report - https://drive.google.com/file/d/0BzFSoGMCVlTORUExdF9RTklpX3c/view
More details - https://github.com/mxmssh/drltrace/wiki/Malware-Analysis-Examples 44
Example II. Gootkit Loader
drltrace.exe -logdir . -print_ret_addr -- 477c305~f01.exe
45
Example II. Gootkit Loader. Unpacking
46
Example II. Gootkit Loader. Process Hollowing. New Process Creation
47
Example II. Gootkit Loader. Process Hollowing. New Section
48
Example II. Gootkit Loader. Process Hollowing. Write & Resume
49
Example II. Gootkit Loader
50
Example II. Gootkit Loader
51
Example II. Gootkit Loader
52
DEMO. NotPetya/PetrWrap
53
54
Drltrace. API calls visualization script
python api_calls_vis.py -i wannacry.jpeg -gr -t drltrace_log_wannacry.log
55
Drltrace. API calls visualization script
python api_calls_vis.py -ht wannacry.html -gr -t drltrace_log_wannacry.log
56
Future Work
● Make DynamoRIO more resistant against anti-DBI
tricks.
● Add heuristics to search for certain (YARA
rules?) malicious patterns in logs.
● ARM and macOS.
● Attach drltrace into running process
57
Conclusion
● Dynamic binary instrumentation is a reasonable trade-off for
dynamic malware analysis.
● Drltrace is the first efficient and light-weight solution for
API calls tracing in modern sophisticated malicious samples
based on DBI technique.
● The solution allowed to revel in several minutes a lot of
internal technical details about malicious sample without even
starting IDA or debugger.
58
Thank you!
https://github.com/mxmssh/drltrace
https://www.linkedin.com/in/mshudrak
https://twitter.com/MShudrak

More Related Content

What's hot

Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013midnite_runr
 
Advanced Evasion Techniques by Win32/Gapz
Advanced Evasion Techniques by Win32/GapzAdvanced Evasion Techniques by Win32/Gapz
Advanced Evasion Techniques by Win32/GapzAlex Matrosov
 
Automated Detection of Software Bugs and Vulnerabilities in Linux
Automated Detection of Software Bugs and Vulnerabilities in LinuxAutomated Detection of Software Bugs and Vulnerabilities in Linux
Automated Detection of Software Bugs and Vulnerabilities in LinuxSilvio Cesare
 
Cryptographic algorithms diversity: Russian (GOST) crypto algorithms
Cryptographic algorithms diversity: Russian (GOST) crypto algorithmsCryptographic algorithms diversity: Russian (GOST) crypto algorithms
Cryptographic algorithms diversity: Russian (GOST) crypto algorithmsDmitry Baryshkov
 
Malicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareMalicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareTakahiro Haruyama
 
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginFast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginTakahiro Haruyama
 
Software Security - Static Analysis Tools
Software Security - Static Analysis ToolsSoftware Security - Static Analysis Tools
Software Security - Static Analysis ToolsEmanuela Boroș
 
I Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugXI Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugXTakahiro Haruyama
 
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...Maksim Shudrak
 
One-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisOne-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisTakahiro Haruyama
 
Rahul-Analysis_of_Adversarial_Code
Rahul-Analysis_of_Adversarial_CodeRahul-Analysis_of_Adversarial_Code
Rahul-Analysis_of_Adversarial_Codeguest66dc5f
 
Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...
Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...
Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...Maksim Shudrak
 
HackInBo2k16 - Threat Intelligence and Malware Analysis
HackInBo2k16 - Threat Intelligence and Malware AnalysisHackInBo2k16 - Threat Intelligence and Malware Analysis
HackInBo2k16 - Threat Intelligence and Malware AnalysisAntonio Parata
 
CheckPlease - Payload-Agnostic Implant Security
CheckPlease - Payload-Agnostic Implant SecurityCheckPlease - Payload-Agnostic Implant Security
CheckPlease - Payload-Agnostic Implant SecurityBrandon Arvanaghi
 
Rafa Sánchez & Fran Gomez - IoCker - When IPv6 met malware [rooted2019]
Rafa Sánchez & Fran Gomez - IoCker - When IPv6 met malware [rooted2019]Rafa Sánchez & Fran Gomez - IoCker - When IPv6 met malware [rooted2019]
Rafa Sánchez & Fran Gomez - IoCker - When IPv6 met malware [rooted2019]RootedCON
 
john-devkit: 100 типов хешей спустя / john-devkit: 100 Hash Types Later
john-devkit: 100 типов хешей спустя / john-devkit: 100 Hash Types Laterjohn-devkit: 100 типов хешей спустя / john-devkit: 100 Hash Types Later
john-devkit: 100 типов хешей спустя / john-devkit: 100 Hash Types LaterPositive Hack Days
 
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valeroRooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valeroRootedCON
 

What's hot (20)

Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
 
Advanced Evasion Techniques by Win32/Gapz
Advanced Evasion Techniques by Win32/GapzAdvanced Evasion Techniques by Win32/Gapz
Advanced Evasion Techniques by Win32/Gapz
 
Automated Detection of Software Bugs and Vulnerabilities in Linux
Automated Detection of Software Bugs and Vulnerabilities in LinuxAutomated Detection of Software Bugs and Vulnerabilities in Linux
Automated Detection of Software Bugs and Vulnerabilities in Linux
 
Cryptographic algorithms diversity: Russian (GOST) crypto algorithms
Cryptographic algorithms diversity: Russian (GOST) crypto algorithmsCryptographic algorithms diversity: Russian (GOST) crypto algorithms
Cryptographic algorithms diversity: Russian (GOST) crypto algorithms
 
Malicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareMalicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic Software
 
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginFast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
 
Software Security - Static Analysis Tools
Software Security - Static Analysis ToolsSoftware Security - Static Analysis Tools
Software Security - Static Analysis Tools
 
I Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugXI Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugX
 
Inside Winnyp
Inside WinnypInside Winnyp
Inside Winnyp
 
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
 
One-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisOne-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic Analysis
 
Rahul-Analysis_of_Adversarial_Code
Rahul-Analysis_of_Adversarial_CodeRahul-Analysis_of_Adversarial_Code
Rahul-Analysis_of_Adversarial_Code
 
Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...
Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...
Zero bugs found? Hold my beer AFL! how to improve coverage-guided fuzzing and...
 
HackInBo2k16 - Threat Intelligence and Malware Analysis
HackInBo2k16 - Threat Intelligence and Malware AnalysisHackInBo2k16 - Threat Intelligence and Malware Analysis
HackInBo2k16 - Threat Intelligence and Malware Analysis
 
CheckPlease - Payload-Agnostic Implant Security
CheckPlease - Payload-Agnostic Implant SecurityCheckPlease - Payload-Agnostic Implant Security
CheckPlease - Payload-Agnostic Implant Security
 
Rafa Sánchez & Fran Gomez - IoCker - When IPv6 met malware [rooted2019]
Rafa Sánchez & Fran Gomez - IoCker - When IPv6 met malware [rooted2019]Rafa Sánchez & Fran Gomez - IoCker - When IPv6 met malware [rooted2019]
Rafa Sánchez & Fran Gomez - IoCker - When IPv6 met malware [rooted2019]
 
Winnti Polymorphism
Winnti PolymorphismWinnti Polymorphism
Winnti Polymorphism
 
john-devkit: 100 типов хешей спустя / john-devkit: 100 Hash Types Later
john-devkit: 100 типов хешей спустя / john-devkit: 100 Hash Types Laterjohn-devkit: 100 типов хешей спустя / john-devkit: 100 Hash Types Later
john-devkit: 100 типов хешей спустя / john-devkit: 100 Hash Types Later
 
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valeroRooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
 
The Veil-Framework
The Veil-FrameworkThe Veil-Framework
The Veil-Framework
 

Similar to Tricky sample? Hack it easy! Applying dynamic binary inastrumentation to lightweight malware behaviour analysis

The Future of Automated Malware Generation
The Future of Automated Malware GenerationThe Future of Automated Malware Generation
The Future of Automated Malware GenerationStephan Chenette
 
Dmitriy D1g1 Evdokimov - DBI Intro
Dmitriy D1g1 Evdokimov - DBI IntroDmitriy D1g1 Evdokimov - DBI Intro
Dmitriy D1g1 Evdokimov - DBI IntroDefconRussia
 
Deep dive nella supply chain della nostra infrastruttura cloud
Deep dive nella supply chain della nostra infrastruttura cloudDeep dive nella supply chain della nostra infrastruttura cloud
Deep dive nella supply chain della nostra infrastruttura cloudsparkfabrik
 
Stuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learnedStuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learnedYury Chemerkin
 
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...sparkfabrik
 
EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22MichaelM85042
 
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022lior mazor
 
From Thousands of Hours to a Couple of Minutes: Automating Exploit Generation...
From Thousands of Hours to a Couple of Minutes: Automating Exploit Generation...From Thousands of Hours to a Couple of Minutes: Automating Exploit Generation...
From Thousands of Hours to a Couple of Minutes: Automating Exploit Generation...Priyanka Aash
 
DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...
DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...
DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...Felipe Prado
 
The Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
The Nightmare Fuzzing Suite and Blind Code Coverage FuzzerThe Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
The Nightmare Fuzzing Suite and Blind Code Coverage FuzzerJoxean Koret
 
Reverse Engineering 101
Reverse Engineering 101Reverse Engineering 101
Reverse Engineering 101ysurer
 
Exploring billion states of a program like a pro. How to cook your own fast a...
Exploring billion states of a program like a pro. How to cook your own fast a...Exploring billion states of a program like a pro. How to cook your own fast a...
Exploring billion states of a program like a pro. How to cook your own fast a...Maksim Shudrak
 
Изучаем миллиард состояний программы на уровне профи. Как разработать быстрый...
Изучаем миллиард состояний программы на уровне профи. Как разработать быстрый...Изучаем миллиард состояний программы на уровне профи. Как разработать быстрый...
Изучаем миллиард состояний программы на уровне профи. Как разработать быстрый...Positive Hack Days
 
Linux IoT Botnet Wars and the lack of basic security hardening
Linux IoT Botnet Wars and the lack of basic security hardeningLinux IoT Botnet Wars and the lack of basic security hardening
Linux IoT Botnet Wars and the lack of basic security hardeningMender.io
 
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...ITCamp
 
Rahul - Analysis Of Adversarial Code - ClubHack2007
Rahul - Analysis Of Adversarial Code - ClubHack2007Rahul - Analysis Of Adversarial Code - ClubHack2007
Rahul - Analysis Of Adversarial Code - ClubHack2007ClubHack
 
Malware-Reverse-Engineering-BeginnerToAdvanced-By-Abhijit-Mohanta-1.pdf
Malware-Reverse-Engineering-BeginnerToAdvanced-By-Abhijit-Mohanta-1.pdfMalware-Reverse-Engineering-BeginnerToAdvanced-By-Abhijit-Mohanta-1.pdf
Malware-Reverse-Engineering-BeginnerToAdvanced-By-Abhijit-Mohanta-1.pdfAbhijit Mohanta
 
Reverse Engineering Malware - A Practical Guide
Reverse Engineering Malware - A Practical GuideReverse Engineering Malware - A Practical Guide
Reverse Engineering Malware - A Practical Guideintertelinvestigations
 
михаил дударев
михаил дударевмихаил дударев
михаил дударевapps4allru
 
Machine learning in cybersecutiry
Machine learning in cybersecutiryMachine learning in cybersecutiry
Machine learning in cybersecutiryVishwas N
 

Similar to Tricky sample? Hack it easy! Applying dynamic binary inastrumentation to lightweight malware behaviour analysis (20)

The Future of Automated Malware Generation
The Future of Automated Malware GenerationThe Future of Automated Malware Generation
The Future of Automated Malware Generation
 
Dmitriy D1g1 Evdokimov - DBI Intro
Dmitriy D1g1 Evdokimov - DBI IntroDmitriy D1g1 Evdokimov - DBI Intro
Dmitriy D1g1 Evdokimov - DBI Intro
 
Deep dive nella supply chain della nostra infrastruttura cloud
Deep dive nella supply chain della nostra infrastruttura cloudDeep dive nella supply chain della nostra infrastruttura cloud
Deep dive nella supply chain della nostra infrastruttura cloud
 
Stuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learnedStuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learned
 
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
Drupal Dev Days Vienna 2023 - What is the secure software supply chain and th...
 
EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22
 
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
 
From Thousands of Hours to a Couple of Minutes: Automating Exploit Generation...
From Thousands of Hours to a Couple of Minutes: Automating Exploit Generation...From Thousands of Hours to a Couple of Minutes: Automating Exploit Generation...
From Thousands of Hours to a Couple of Minutes: Automating Exploit Generation...
 
DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...
DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...
DEF CON 27 - workshop ANTHONY ROSE - introduction to amsi bypasses and sandbo...
 
The Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
The Nightmare Fuzzing Suite and Blind Code Coverage FuzzerThe Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
The Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
 
Reverse Engineering 101
Reverse Engineering 101Reverse Engineering 101
Reverse Engineering 101
 
Exploring billion states of a program like a pro. How to cook your own fast a...
Exploring billion states of a program like a pro. How to cook your own fast a...Exploring billion states of a program like a pro. How to cook your own fast a...
Exploring billion states of a program like a pro. How to cook your own fast a...
 
Изучаем миллиард состояний программы на уровне профи. Как разработать быстрый...
Изучаем миллиард состояний программы на уровне профи. Как разработать быстрый...Изучаем миллиард состояний программы на уровне профи. Как разработать быстрый...
Изучаем миллиард состояний программы на уровне профи. Как разработать быстрый...
 
Linux IoT Botnet Wars and the lack of basic security hardening
Linux IoT Botnet Wars and the lack of basic security hardeningLinux IoT Botnet Wars and the lack of basic security hardening
Linux IoT Botnet Wars and the lack of basic security hardening
 
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
Programming on Windows 8.1: The New Stream and Storage Paradigm (Raffaele Ria...
 
Rahul - Analysis Of Adversarial Code - ClubHack2007
Rahul - Analysis Of Adversarial Code - ClubHack2007Rahul - Analysis Of Adversarial Code - ClubHack2007
Rahul - Analysis Of Adversarial Code - ClubHack2007
 
Malware-Reverse-Engineering-BeginnerToAdvanced-By-Abhijit-Mohanta-1.pdf
Malware-Reverse-Engineering-BeginnerToAdvanced-By-Abhijit-Mohanta-1.pdfMalware-Reverse-Engineering-BeginnerToAdvanced-By-Abhijit-Mohanta-1.pdf
Malware-Reverse-Engineering-BeginnerToAdvanced-By-Abhijit-Mohanta-1.pdf
 
Reverse Engineering Malware - A Practical Guide
Reverse Engineering Malware - A Practical GuideReverse Engineering Malware - A Practical Guide
Reverse Engineering Malware - A Practical Guide
 
михаил дударев
михаил дударевмихаил дударев
михаил дударев
 
Machine learning in cybersecutiry
Machine learning in cybersecutiryMachine learning in cybersecutiry
Machine learning in cybersecutiry
 

Recently uploaded

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
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 WorkerThousandEyes
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Tricky sample? Hack it easy! Applying dynamic binary inastrumentation to lightweight malware behaviour analysis

  • 1. Tricky Sample ? Hack it easy! Applying dynamic binary instrumentation to light-weight malware behavior analysis Maksim Shudrak
  • 2. About Me BIO 2018 – present: Senior Offensive Security Researcher 2016: Defended PhD (Vulns Hunting) in Tomsk, Russia 2015-2017: Researcher, IBM Research, Haifa, Israel 2011-2015: Security Researcher, PhD student Interests Vulnerabilities Hunting Fuzzing Reverse-engineering Malware Analysis Dynamic Binary Instrumentation Projects Drltrace – transparent API-calls tracing for malware analysis https://github.com/mxmssh/drltrace WinHeap Explorer – PoC for heap-based bugs detection in x86 code https://github.com/WinHeapExplorer/WinHeap-Explorer IDAMetrics – IDA plugin for machine code complexity assessment https://github.com/mxmssh/IDAmetrics
  • 3. Outline ● Why Dynamic Analysis? ● Current approaches ● Runtime Overhead vs Visibility ● Dynamic Binary Instrumentation ● Technique Overview ● DBI Frameworks Comparison ● DrLtrace ● How Does It Work ? ● Usage ● Examples & Demo 3
  • 4. Why dynamic ? ● Obfuscated & packed code hard for static analysis. ● In some cases, we need only a high- level view on malware behavior. 4
  • 5. Current Situation in Dynamic Analysis Runtime overhead Visibility Library Calls Tracing (e.g. APIMonitor) Emulation (e.g. QEMU+PANDA) Syscalls Tracing (e.g. ProcMon) 5
  • 8. 10 min on CPU = 1d08h in emulator 8
  • 13. Current Situationin Dynamic Analysis Runtime overhead Visibility Library Calls Tracing (e.g. APIMonitor) Emulation (e.g. QEMU+PANDA) Syscalls Tracing (e.g. ProcMon) ? 13
  • 14. Current Situationin Dynamic Analysis Runtime overhead Visibility Library Calls Tracing (e.g. APIMonitor) Emulation (e.g. QEMU+PANDA) Syscalls Tracing (e.g. ProcMon) Dynamic Binary Instrumentation (e.g. Intel Pin) 14
  • 15. Dynamic Binary Instrumentation (DBI) is a technique of analyzing the behavior of a binary application at runtime through the injection of instrumentation code. 15
  • 16. Modern DBI Frameworks DynamoRIO Intel PIN Redistribution model Open-source, BSD – license Proprietary Supported architectures x86, x86-64, ARM, AArch64 x86, x86-64 Supported Platforms Linux, Windows, MacOS, Android Linux, Windows, MacOS, Android Average runtime overhead 108% (no tool) 139% (BBs counter) 130% (no tool) 162% (BBs counter) Language C/C++ C/C++ (some Python wrappers available) Technology Binary code transformation callout/trampolines 16
  • 17. How Does DynamoRIO Work ? (10000 foot view) Target applicationLauncher DynamoRIO Application in memory Kernel shared system libs 17
  • 18. How Does DynamoRIO Work ? (10000 foot view) Target applicationLauncher DynamoRIO Launch (suspended) (1) Application in memory Kernel shared system libs . . 18
  • 19. How Does DynamoRIO Work ? (10000 foot view) Launcher DynamoRIO Launch (suspended) (1) Application in memory Kernel (2) Inject instrumentation library Target application shared system libs 19
  • 20. Target application shared system libs How Does DynamoRIO Work ? (10000 foot view) Launcher DynamoRIO Launch (suspended) (1) Application in memory Kernel (3) Hook entry point DynamoRIO lib + user-defined libs 20
  • 21. Target application shared system libs How Does DynamoRIO Work ? (10000 foot view) Launcher DynamoRIO Launch (suspended) (1) Application in memory Kernel (3) Hook entry point DynamoRIO lib + user-defined libs ins2 basic block ins3 ins1 Takefirstbasicblock (4) 21
  • 22. Target application shared system libs How Does DynamoRIO Work ? (10000 foot view) Launcher DynamoRIO Launch (suspended) (1) Application in memory Kernel (3) Hook entry point DynamoRIO lib + user-defined libs ins2 basic block transformation (5) ins1 ins2 DR’s ins6 ins3 ins1 Code cache DR’s ins1 DR’s ins2 DR’s ins3 DR’s ins4 DR’s ins5 ins3 (4) Takefirstbasicblock 22
  • 23. Target application shared system libs How Does DynamoRIO Work ? (10000 foot view) Launcher DynamoRIO Launch (suspended) (1) Application in memory Kernel (3) Hook entry point DynamoRIO lib + user-defined libs Takefirstbasicblock (4) ins2 basic block transformation (5) ins1 ins2 DR’s ins6 ins3 ins1 Code cache DR’s ins1 DR’s ins2 DR’s ins3 DR’s ins4 DR’s ins5 ins3 Takenextbasicblock (6) 23
  • 24. How Does Drltrace Work ? Application in memory Main module kernel32.dll ntdll.dll DBI engine dynamorio.dll drltrace.dll 24
  • 25. How Does Drltrace Work ? Application in memory Main module kernel32.dll ntdll.dll DBI engine dynamorio.dll drltrace.dll 25 InstrumentLoadLibrarycall Setcallback (1) (1.1)
  • 26. How Does Drltrace Work ? Application in memory Main module kernel32.dll ntdll.dll DBI engine dynamorio.dll drltrace.dll 26 InstrumentLoadLibrarycall Setcallback (1) (1.1) LoadLibrary(msvcrt.dll)(2)
  • 27. How Does Drltrace Work ? Application in memory Main module kernel32.dll ntdll.dll DBI engine dynamorio.dll drltrace.dll 27 InstrumentLoadLibrarycall Setcallback (1) (1.1) LoadLibrary(msvcrt.dll)(2) msvcrt.dll (being loaded) Instrumentexportedfunctions (3)
  • 28. DynamoRIO and Drltracelib in The Memory of Calculator 28
  • 30. Why DrLtrace Rock ● Support x86 and x64 (ARM in future). 30
  • 31. Why DrLtrace Rock ● Support x86 and x64 (ARM in future). ● Support Windows and Linux (macOS in future). 31
  • 32. Why DrLtrace Rock ● Support x86 and x64 (ARM in future). ● Support Windows and Linux (macOS in future). ● Support self-modifying code. 32
  • 33. Why DrLtrace Rock ● Support x86 and x64 (ARM in future). ● Support Windows and Linux (macOS in future). ● Support self-modifying code. ● Support all types of library API calls (static and dynamic). 33
  • 34. Why DrLtrace Rock ● Support x86 and x64 (ARM in future). ● Support Windows and Linux (macOS in future). ● Support self-modifying code. ● Support all types of library API calls (static and dynamic). ● Not-detectable by standard malware anti-research techniques (anti-hooking, anti-debugging and anti- emulation). 34
  • 35. Why DrLtrace Rock ● Support x86 and x64 (ARM in future). ● Support Windows and Linux (macOS in future). ● Support self-modifying code. ● Support all types of library API calls (static and dynamic). ● Not-detectable by standard malware anti-research techniques (anti-hooking, anti-debugging and anti- emulation). ● External configuration file to add new API calls. 35
  • 36. Why DrLtrace Rock ● Support x86 and x64 (ARM in future). ● Support Windows and Linux (macOS in future). ● Support self-modifying code. ● Support all types of library API calls (static and dynamic). ● Not-detectable by standard malware anti-research techniques (anti-hooking, anti-debugging and anti- emulation). ● External configuration file to add new API calls. ● Easy-to-use (no additional dependencies, no heavy- weight GUI). 36
  • 37. Why DrLtrace Rock ● Support x86 and x64 (ARM in future). ● Support Windows and Linux (macOS in future). ● Support self-modifying code. ● Support all types of library API calls (static and dynamic). ● Not-detectable by standard malware anti-research techniques (anti-hooking, anti-debugging and anti- emulation). ● External configuration file to add new API calls. ● Easy-to-use (no additional dependencies, no heavy- weight GUI). ● Open-source (BSD-license). 37
  • 38. Runtime Overhead PowerPoint Word Calculator Internet Explorer VMWare IDA PRO StarCraft II Launcher Dropbox Chrome Notepad++ 38 14,7 16,5 20,2 37,2 10 22 44,6 25,6 43,3 32 0 5 10 15 20 25 30 35 40 45 50 RUNTIMEOVERHEAD
  • 39. Example 1. EmbusteBot ● Type - Brazilian BankingTrojan ● Language - Delphi ● Main Functionality – Keylogger,Screenshotscapturing ● Obfuscation – time-based anti-researchchecks,encryptionof sensitivestrings,no code packing ● Operation period – (2017 – present) Report- https://securityintelligence.com/brazilian-malware-never-sleeps-meet-embustebot/ More details - https://github.com/mxmssh/drltrace/wiki/Malware-Analysis-Examples 39
  • 40. Example 1. EmbusteBot drltrace.exe -logdir . -print_ret_addr – vdeis.exe 40
  • 41. Example I. EmbusteBot. Searching for Tab with Bank Name 41
  • 42. Example I. EmbusteBot. Screenshots Capturing and Keylogging API Calls 42
  • 44. Example II. Gootkit Loader ● Type : Banking Trojan ● Language : C ● Main Functionality:Unpack actual payload loader, deliver Gootkit malware on victim’s machine ● Obfuscation: anti-VM, anti-debugging, anti-emulation,time-based anti-research, packed payload, machine- code obfuscation, anti-sandboxing. ● Operation period: (2014 – present) Technical report - https://drive.google.com/file/d/0BzFSoGMCVlTORUExdF9RTklpX3c/view More details - https://github.com/mxmssh/drltrace/wiki/Malware-Analysis-Examples 44
  • 45. Example II. Gootkit Loader drltrace.exe -logdir . -print_ret_addr -- 477c305~f01.exe 45
  • 46. Example II. Gootkit Loader. Unpacking 46
  • 47. Example II. Gootkit Loader. Process Hollowing. New Process Creation 47
  • 48. Example II. Gootkit Loader. Process Hollowing. New Section 48
  • 49. Example II. Gootkit Loader. Process Hollowing. Write & Resume 49
  • 50. Example II. Gootkit Loader 50
  • 51. Example II. Gootkit Loader 51
  • 52. Example II. Gootkit Loader 52
  • 54. 54
  • 55. Drltrace. API calls visualization script python api_calls_vis.py -i wannacry.jpeg -gr -t drltrace_log_wannacry.log 55
  • 56. Drltrace. API calls visualization script python api_calls_vis.py -ht wannacry.html -gr -t drltrace_log_wannacry.log 56
  • 57. Future Work ● Make DynamoRIO more resistant against anti-DBI tricks. ● Add heuristics to search for certain (YARA rules?) malicious patterns in logs. ● ARM and macOS. ● Attach drltrace into running process 57
  • 58. Conclusion ● Dynamic binary instrumentation is a reasonable trade-off for dynamic malware analysis. ● Drltrace is the first efficient and light-weight solution for API calls tracing in modern sophisticated malicious samples based on DBI technique. ● The solution allowed to revel in several minutes a lot of internal technical details about malicious sample without even starting IDA or debugger. 58