SlideShare uma empresa Scribd logo
1 de 42
Baixar para ler offline
You’re Off the Hook:
Blinding Security Software
Alex Matrosov | Principal Research Scientist
Jeff Tang | Senior Security Researcher
Who We Are - Alex
§ Principal REsearch Scientist @CylanceInc
§ Previously @IntelSecurity / @ESET
§ Co-author of Rootkits and Bootkits: Reversing Modern
Malware and Next Generation Threats
§ @matrosov @matrosov
Who We Are - Jeff
§ Senior Security Researcher @CylanceInc
§ Formerly @VAHNA / @NSAGov
§ Hates computers – career dedicated to breaking computers
§ @mrjefftang @mrjefftang
Overview
§ Why user-mode hooks?
§ Hooking Basics
§ Hooking Vulnerabilities (Captain Hook)
§ Control Flow Guard / Return Flow Guard
§ Universal Unhooking
§ Demo / Results
Why user-mode hooking?
§ Kernel Patch Protection (KPP) a.k.a. “PatchGuard”
§ Introduced in 2005 for Windows 2003 SP1 x64 – multiple revisions since then
§ Prevents modification to the Windows kernel and kernel data structures
§ IDT, GDT, SSDT, MSR, System PE Images
§ Analysis and bypasses documented by various security researchers (skape, skywing)
§ Bypasses implemented by malware rootkits (Uroburos)
§ Incrementally updated to address deficiencies and block bypasses
§ Creates an arms race between independent software vendors (ISV) and Microsoft
§ Forces security vendors to rely on user-mode hooking in order to monitor processes for
malicious behavior
§ http://blog.talosintel.com/2014/08/the-windows-81-kernel-patch-protection.html
User-Mode Hooking Basics
§ IAT Hooking
§ Replace address of target function in IAT with address to a new function
§ Inline Hooking
§ Replaces the prologue of target functions with a jmp to a detour
§ Detour function calls a trampoline function
§ Trampoline function contains the function’s original prologue and jmp into the original function
§ Original function returns into detour
§ Detour returns to caller
§ http://jbremer.org/x86-api-hooking-demystified/
(Inline) Hooking Basics
Inline Hooking
Hooking Issues (Captain Hook)
§ Documented by the enSilo Research Team & presented at BlackHat US 2016
§ Captain Hook: Pirating AVs to Bypass Exploit Mitigations
§ Discovered 6 classes of major vulnerabilities in user-mode hooking
Hooking Issues (Captain Hook)
https://www.blackhat.com/docs/us-16/materials/us-16-Yavo-Captain-Hook-Pirating-AVs-To-Bypass-Exploit-Mitigations.pdf
Hooking Issues (Captain Hook)
§ Unsafe Injection
§ Predictable RWX (Universal)
§ Predictable RX
§ Predictable RWX (Windows 7 and below)
§ RWX Hook Code Stubs
§ RWX Hooked Modules
https://www.blackhat.com/docs/us-16/materials/us-16-Yavo-Captain-Hook-Pirating-AVs-To-Bypass-Exploit-Mitigations.pdf
Control Flow Guard (CFG)
§ Introduced with Windows 10 / Windows 8.1 Update 3
§ Requires support from the compiler/linker and operating system
§ Compiler generates CFG instrumented binaries (/guard:cf)
§ Embeds a CFG Bitmap representing valid indirect call locations
§ Inserts _guard_check_icall before indirect calls
§ Operating system supports CFG at run time:
§ Supported OS maps guard check to ntdll!LdrpValidateUserCallTarget
§ Unsupported OS is just a simple ret
§ Not perfect, there are bypasses available
§ Functions left RWX by a hooking engine bypass CFG as they can be overwritten with shellcode
Return Flow Guard (RFG)
§ Upcoming technology likely to be introduced in Windows 10 Creators Update
§ Protects return address by comparing it to the saved value on a shadow stack (fs:[rsp])
§ Requires support from the compiler/linker and operating system
§ Compiler generates an RFG instrumented binary
§ Inserts no-op padding in function prologue and epilogues
§ Operating system supports RFG at run time:
§ Overwrites prologue with instructions to save return address to shadow stack
§ Overwrites epilogue with instructions to check return address against shadow stack
§ http://xlab.tencent.com/en/2016/11/02/return-flow-guard/
Return Flow Guard (RFG)
Return Flow Guard (RFG)
Prior Work
§ Unhooking has been around for a long time
§ Generally relies on identifying specific hooking methods/signatures
§ Focuses in hooks installed in function prologues
§ https://breakdev.org/defeating-antivirus-real-time-protection-from-the-inside/
§ In-memory RFG instrumented binaries will be different than on-disk – unhooking will remove the
RFG prologue/epilogue patches
§ Endpoint detect & respond (EDR) products rely heavily on user-mode hooking for telemetry
Universal Unhooking DLL
§ For each module in PEB_LDR_DATA->InMemoryOrderModuleList:
ü Load the module from disk
ü Allocate a new memory space of NtHeader->OptionalHeader.SizeOfImage
ü Perform PE relocations based off original module base address
ü Resolve Import Address Table (IAT)
ü Compare our new copy with the original copy
ü Copy over our pristine copy if changes are detected
§ Based off of Stephen Fewer’s Reflective DLL Injection code
Universal Unhooking DLL - Loading
§ Load the file into memory
ü CreateFile(“ntdll.dll”, …)
ü CreateFileMapping(...)
ü MapViewOfFile(...)
ü <new base address> = VirtualAlloc(...,
NtHeader->Optionalheader.SizeOfImage, …)
§ Copy PE sections into correct location in memory
ü memcpy(<new base address> + SectionHeader->VirtualAddress,
SectionHeader->PointerToRawData)
Universal Unhooking DLL - Relocation
§ The normal relocation process adds an image delta to each relocation
ü delta = loaded base address - OptionalHeader.ImageBase
§ Or it adds the high/low word of the delta depending on relocation type
§ Our unhooking code performs relocation with the loaded base address of the original loaded DLL
ü delta = original base address - OptionalHeader.ImageBase
§ This gives us a binary copy of what the DLL looked like after being loaded but
before being hooked
Universal Unhooking DLL – Import Resolution
§ Need to resolve the import table without bringing in a hooked function
§ Custom GetProcAddress to parse the IMAGE_EXPORT_DIRECTORY of each module
§ Must support export forward descriptors and API Sets
§ A forward descriptor is a function that resolves to a virtual address within the
IMAGE_EXPORT_DIRECTORY address space
Universal Unhooking DLL – Import Resolution
API Set Schema
§ Introduced in Windows 7 (v2) as part of project “MinWin”
§ Updated in Windows 8.1 (v4) and Windows 10 (v6)
§ Mapping of “Virtual DLLs” to “Logical DLLs” stored in apisetschema.dll
§ Very little documented information on API Set Schema
§ http://www.geoffchappell.com/studies/windows/win32/apisetschema/index.htm
§ http://blog.quarkslab.com/runtime-dll-name-resolution-apisetschema-part-i.html
§ http://blog.quarkslab.com/runtime-dll-name-resolution-apisetschema-part-ii.html
API Set Schema - Example
API Set Schema - Evolution
API Set Schema
Universal Unhooking DLL – Compare & Restore
§ Compare each PE section of the original loaded DLL to our version
§ Replace any sections which are different
§ Return back to initial program to continue execution without hooks
Reflective DLL
§ The universal unhooking code is compiled as a reflective DLL
§ Meterpreter: post/windows/manage/reflective_dll_inject
§ Can be injected into everything!
Meterpreter
§ Meterpreter server is already delivered as a Reflective DLL
§ Security software could detect Meterpreter initialization prior to unhooking
§ Solution: Modify meterpreter server to call unhooking code before connection initialization
§ Drop in replacement for Metasploit installs
§ Copy modified metsrv.dll to metasploit-framework/data/meterpreter/
UPX
§ Why UPX?
§ It’s well known and open-source
§ Modify UPX to insert an extra section ‘UPX3’ containing arbitrary reflective DLL
§ UPX decoder stub unpacks original binary and resolves imports
§ Decoder calls the first export in the reflective DLL (ReflectiveLoader())
§ Unhooking code runs and removes any hooks detected
§ Stub decoder jumps to original entry point (OEP)
§ Note: Reflective DLL is not compressed by UPX
§ Also blows up the size of the final packed executable
UPX
UPX
§ Final basic block of UPX stub decoder
§ call sub_5C46A0 – ReflectiveLoader()
§ jmp word_46E0E6 – Original Entry Point (OEP)
§ Note: On 64-bit platforms, rsp must be 16-bit aligned
before the call to ReflectiveLoader()
UPX
§ Problem: Once UPX unpacks binary into memory, it will be different compared to on disk copy –
how does the unhooking code avoid reloading packed binary into memory?
UPX
§ Unhooking code ignores any PE section with IMAGE_SCN_MEM_WRITE (0x80000000)
§ UPX marks every section as PEFL_WRITE == IMAGE_SCN_MEM_WRITE
UPX
Demo
Results
Software Result
BitDefender Success - Bypassed
Dr. Web Success - Bypassed
ESET Blocked
Kaspersky Blocked
Symantec Success - Unaffected
McAfee Success - Unaffected
TrendMicro Success - Unaffected
EMET Success - Unaffected
Blinding Security Software
Future Work
§ Improve UPX modifications to compress/pack the reflective DLL
§ Update ReflectiveLoader() to perform unhooking checks and repairs
§ Support for other packing software?
Closing
§ User-mode hooking is fragile and easily bypassed
§ Relying on user-mode hooking for protection is ineffective
§ Critical need for OS support to provide callbacks and APIs for monitoring system behavior
§ Source code will be released soon @ https://github.com/CylanceVulnResearch/
QUESTIONS
AND
ANSWERS
THANK YOU
ZERONIGHTS 2016
You're Off the Hook: Blinding Security Software

Mais conteúdo relacionado

Mais procurados

Breaking paravirtualized devices
Breaking paravirtualized devicesBreaking paravirtualized devices
Breaking paravirtualized devicesPriyanka Aash
 
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...CODE BLUE
 
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...CODE BLUE
 
Digging for Android Kernel Bugs
Digging for Android Kernel BugsDigging for Android Kernel Bugs
Digging for Android Kernel BugsJiahong Fang
 
Tracking vulnerable JARs
Tracking vulnerable JARsTracking vulnerable JARs
Tracking vulnerable JARsDavid Jorm
 
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" Peter Hlavaty
 
Find your own iOS kernel bug
Find your own iOS kernel bugFind your own iOS kernel bug
Find your own iOS kernel bugGustavo Martinez
 
Crash Dump Analysis 101
Crash Dump Analysis 101Crash Dump Analysis 101
Crash Dump Analysis 101John Howard
 
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)Shota Shinogi
 
Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...
Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...
Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...Jennifer Shelton
 
Automotive Grade Linux and systemd
Automotive Grade Linux and systemdAutomotive Grade Linux and systemd
Automotive Grade Linux and systemdAlison Chaiken
 
Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Peter Hlavaty
 
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...CanSecWest
 
How to reverse engineer Android applications
How to reverse engineer Android applicationsHow to reverse engineer Android applications
How to reverse engineer Android applicationshubx
 
Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?Sarath C
 
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗Macpaul Lin
 
How to Root 10 Million Phones with One Exploit
How to Root 10 Million Phones with One ExploitHow to Root 10 Million Phones with One Exploit
How to Root 10 Million Phones with One ExploitJiahong Fang
 
Crash dump analysis - experience sharing
Crash dump analysis - experience sharingCrash dump analysis - experience sharing
Crash dump analysis - experience sharingJames Hsieh
 
Rainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could ExpectRainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could ExpectPeter Hlavaty
 
Kernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driverKernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driverAnne Nicolas
 

Mais procurados (20)

Breaking paravirtualized devices
Breaking paravirtualized devicesBreaking paravirtualized devices
Breaking paravirtualized devices
 
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
 
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
 
Digging for Android Kernel Bugs
Digging for Android Kernel BugsDigging for Android Kernel Bugs
Digging for Android Kernel Bugs
 
Tracking vulnerable JARs
Tracking vulnerable JARsTracking vulnerable JARs
Tracking vulnerable JARs
 
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel" You didnt see it’s coming? "Dawn of hardened Windows Kernel"
You didnt see it’s coming? "Dawn of hardened Windows Kernel"
 
Find your own iOS kernel bug
Find your own iOS kernel bugFind your own iOS kernel bug
Find your own iOS kernel bug
 
Crash Dump Analysis 101
Crash Dump Analysis 101Crash Dump Analysis 101
Crash Dump Analysis 101
 
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
Introduction of ShinoBOT (Black Hat USA 2013 Arsenal)
 
Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...
Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...
Lecture1: NGS Analysis on Beocat and an introduction to Perl programming for ...
 
Automotive Grade Linux and systemd
Automotive Grade Linux and systemdAutomotive Grade Linux and systemd
Automotive Grade Linux and systemd
 
Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!
 
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
CSW2017Richard Johnson_harnessing intel processor trace on windows for vulner...
 
How to reverse engineer Android applications
How to reverse engineer Android applicationsHow to reverse engineer Android applications
How to reverse engineer Android applications
 
Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?Tip: How to enable wireless debugging with Android?
Tip: How to enable wireless debugging with Android?
 
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
 
How to Root 10 Million Phones with One Exploit
How to Root 10 Million Phones with One ExploitHow to Root 10 Million Phones with One Exploit
How to Root 10 Million Phones with One Exploit
 
Crash dump analysis - experience sharing
Crash dump analysis - experience sharingCrash dump analysis - experience sharing
Crash dump analysis - experience sharing
 
Rainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could ExpectRainbow Over the Windows: More Colors Than You Could Expect
Rainbow Over the Windows: More Colors Than You Could Expect
 
Kernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driverKernel Recipes 2015: Anatomy of an atomic KMS driver
Kernel Recipes 2015: Anatomy of an atomic KMS driver
 

Destaque

Embracing Threat Intelligence and Finding ROI in Your Decision
Embracing Threat Intelligence and Finding ROI in Your DecisionEmbracing Threat Intelligence and Finding ROI in Your Decision
Embracing Threat Intelligence and Finding ROI in Your DecisionCylance
 
Exploring the Capabilities and Economics of Cybercrime
Exploring the Capabilities and Economics of CybercrimeExploring the Capabilities and Economics of Cybercrime
Exploring the Capabilities and Economics of CybercrimeCylance
 
Corporations - the new victims of targeted ransomware
Corporations - the new victims of targeted ransomwareCorporations - the new victims of targeted ransomware
Corporations - the new victims of targeted ransomwareCyber Security Alliance
 
UEFI Firmware Rootkits: Myths and Reality
UEFI Firmware Rootkits: Myths and RealityUEFI Firmware Rootkits: Myths and Reality
UEFI Firmware Rootkits: Myths and RealitySally Feller
 
Zeronights 2016 | A blow under the belt. How to avoid WAF/IPS/DLP | Удар ниже...
Zeronights 2016 | A blow under the belt. How to avoid WAF/IPS/DLP | Удар ниже...Zeronights 2016 | A blow under the belt. How to avoid WAF/IPS/DLP | Удар ниже...
Zeronights 2016 | A blow under the belt. How to avoid WAF/IPS/DLP | Удар ниже...Дмитрий Бумов
 
Presentación cylance
Presentación cylancePresentación cylance
Presentación cylancevictor bueno
 
DeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelPeter Hlavaty
 
Robots are among us, but who takes responsibility?
Robots are among us, but who takes responsibility?Robots are among us, but who takes responsibility?
Robots are among us, but who takes responsibility?Cyber Security Alliance
 
The Case For Continuous Security
The Case For Continuous SecurityThe Case For Continuous Security
The Case For Continuous SecurityThreat Stack
 
How to Close the SecOps Gap
How to Close the SecOps GapHow to Close the SecOps Gap
How to Close the SecOps GapBMC Software
 
10 Hot Digital UK Start-ups To Watch In 2017
10 Hot Digital UK Start-ups To Watch In 201710 Hot Digital UK Start-ups To Watch In 2017
10 Hot Digital UK Start-ups To Watch In 2017Kaitlin McAndrews
 
end-to-end service management with ServiceNow (English)
end-to-end service management with ServiceNow (English)end-to-end service management with ServiceNow (English)
end-to-end service management with ServiceNow (English)Orange Business Services
 
Applying eTOM (enhanced Telecom Operations Map) Framework to Non-Telecommunic...
Applying eTOM (enhanced Telecom Operations Map) Framework to Non-Telecommunic...Applying eTOM (enhanced Telecom Operations Map) Framework to Non-Telecommunic...
Applying eTOM (enhanced Telecom Operations Map) Framework to Non-Telecommunic...Alan McSweeney
 
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_markCSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_markCanSecWest
 
CSW2017 Qidan he+Gengming liu_cansecwest2017
CSW2017 Qidan he+Gengming liu_cansecwest2017CSW2017 Qidan he+Gengming liu_cansecwest2017
CSW2017 Qidan he+Gengming liu_cansecwest2017CanSecWest
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
 

Destaque (18)

Embracing Threat Intelligence and Finding ROI in Your Decision
Embracing Threat Intelligence and Finding ROI in Your DecisionEmbracing Threat Intelligence and Finding ROI in Your Decision
Embracing Threat Intelligence and Finding ROI in Your Decision
 
Exploring the Capabilities and Economics of Cybercrime
Exploring the Capabilities and Economics of CybercrimeExploring the Capabilities and Economics of Cybercrime
Exploring the Capabilities and Economics of Cybercrime
 
Corporations - the new victims of targeted ransomware
Corporations - the new victims of targeted ransomwareCorporations - the new victims of targeted ransomware
Corporations - the new victims of targeted ransomware
 
UEFI Firmware Rootkits: Myths and Reality
UEFI Firmware Rootkits: Myths and RealityUEFI Firmware Rootkits: Myths and Reality
UEFI Firmware Rootkits: Myths and Reality
 
Zeronights 2016 | A blow under the belt. How to avoid WAF/IPS/DLP | Удар ниже...
Zeronights 2016 | A blow under the belt. How to avoid WAF/IPS/DLP | Удар ниже...Zeronights 2016 | A blow under the belt. How to avoid WAF/IPS/DLP | Удар ниже...
Zeronights 2016 | A blow under the belt. How to avoid WAF/IPS/DLP | Удар ниже...
 
Presentación cylance
Presentación cylancePresentación cylance
Presentación cylance
 
DeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows Kernel
 
Robots are among us, but who takes responsibility?
Robots are among us, but who takes responsibility?Robots are among us, but who takes responsibility?
Robots are among us, but who takes responsibility?
 
Cylance Protect-Next-Generation Antivirus-Overview
Cylance Protect-Next-Generation Antivirus-OverviewCylance Protect-Next-Generation Antivirus-Overview
Cylance Protect-Next-Generation Antivirus-Overview
 
The Case For Continuous Security
The Case For Continuous SecurityThe Case For Continuous Security
The Case For Continuous Security
 
Cylance Information Security: Compromise Assessment Datasheet
Cylance Information Security: Compromise Assessment DatasheetCylance Information Security: Compromise Assessment Datasheet
Cylance Information Security: Compromise Assessment Datasheet
 
How to Close the SecOps Gap
How to Close the SecOps GapHow to Close the SecOps Gap
How to Close the SecOps Gap
 
10 Hot Digital UK Start-ups To Watch In 2017
10 Hot Digital UK Start-ups To Watch In 201710 Hot Digital UK Start-ups To Watch In 2017
10 Hot Digital UK Start-ups To Watch In 2017
 
end-to-end service management with ServiceNow (English)
end-to-end service management with ServiceNow (English)end-to-end service management with ServiceNow (English)
end-to-end service management with ServiceNow (English)
 
Applying eTOM (enhanced Telecom Operations Map) Framework to Non-Telecommunic...
Applying eTOM (enhanced Telecom Operations Map) Framework to Non-Telecommunic...Applying eTOM (enhanced Telecom Operations Map) Framework to Non-Telecommunic...
Applying eTOM (enhanced Telecom Operations Map) Framework to Non-Telecommunic...
 
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_markCSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
CSW2017 Peng qiu+shefang-zhong win32k -dark_composition_finnal_finnal_rm_mark
 
CSW2017 Qidan he+Gengming liu_cansecwest2017
CSW2017 Qidan he+Gengming liu_cansecwest2017CSW2017 Qidan he+Gengming liu_cansecwest2017
CSW2017 Qidan he+Gengming liu_cansecwest2017
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 

Semelhante a You're Off the Hook: Blinding Security Software

Buffer overflow – Smashing The Stack
Buffer overflow – Smashing The StackBuffer overflow – Smashing The Stack
Buffer overflow – Smashing The StackTomer Zait
 
Shellcode Analysis - Basic and Concept
Shellcode Analysis - Basic and ConceptShellcode Analysis - Basic and Concept
Shellcode Analysis - Basic and ConceptJulia Yu-Chin Cheng
 
OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)Jooho Lee
 
Buffer Overflow - Smashing the Stack
Buffer Overflow - Smashing the StackBuffer Overflow - Smashing the Stack
Buffer Overflow - Smashing the StackironSource
 
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Elvin Gentiles
 
How to reverse engineer Android applications—using a popular word game as an ...
How to reverse engineer Android applications—using a popular word game as an ...How to reverse engineer Android applications—using a popular word game as an ...
How to reverse engineer Android applications—using a popular word game as an ...Christoph Matthies
 
The Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldThe Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldDevOps.com
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...Hackito Ergo Sum
 
Using VPP and SRIO-V with Clear Containers
Using VPP and SRIO-V with Clear ContainersUsing VPP and SRIO-V with Clear Containers
Using VPP and SRIO-V with Clear ContainersMichelle Holley
 
Finding Xori: Malware Analysis Triage with Automated Disassembly
Finding Xori: Malware Analysis Triage with Automated DisassemblyFinding Xori: Malware Analysis Triage with Automated Disassembly
Finding Xori: Malware Analysis Triage with Automated DisassemblyPriyanka Aash
 
Linux kernel-rootkit-dev - Wonokaerun
Linux kernel-rootkit-dev - WonokaerunLinux kernel-rootkit-dev - Wonokaerun
Linux kernel-rootkit-dev - Wonokaerunidsecconf
 
Spark Summit EU talk by Jorg Schad
Spark Summit EU talk by Jorg SchadSpark Summit EU talk by Jorg Schad
Spark Summit EU talk by Jorg SchadSpark Summit
 
Squash Those IoT Security Bugs with a Hardened System Profile
Squash Those IoT Security Bugs with a Hardened System ProfileSquash Those IoT Security Bugs with a Hardened System Profile
Squash Those IoT Security Bugs with a Hardened System ProfileSteve Arnold
 
PTK 1.0 official presentation
PTK 1.0 official presentationPTK 1.0 official presentation
PTK 1.0 official presentationDFLABS SRL
 
FortranCon2020: Highly Parallel Fortran and OpenACC Directives
FortranCon2020: Highly Parallel Fortran and OpenACC DirectivesFortranCon2020: Highly Parallel Fortran and OpenACC Directives
FortranCon2020: Highly Parallel Fortran and OpenACC DirectivesJeff Larkin
 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016Susan Potter
 
Chasing the Adder. A tale from the APT world...
Chasing the Adder. A tale from the APT world...Chasing the Adder. A tale from the APT world...
Chasing the Adder. A tale from the APT world...Stefano Maccaglia
 

Semelhante a You're Off the Hook: Blinding Security Software (20)

Buffer overflow – Smashing The Stack
Buffer overflow – Smashing The StackBuffer overflow – Smashing The Stack
Buffer overflow – Smashing The Stack
 
Shellcode Analysis - Basic and Concept
Shellcode Analysis - Basic and ConceptShellcode Analysis - Basic and Concept
Shellcode Analysis - Basic and Concept
 
OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)
 
Buffer Overflow - Smashing the Stack
Buffer Overflow - Smashing the StackBuffer Overflow - Smashing the Stack
Buffer Overflow - Smashing the Stack
 
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
 
Ropython-windbg-python-extensions
Ropython-windbg-python-extensionsRopython-windbg-python-extensions
Ropython-windbg-python-extensions
 
How to reverse engineer Android applications—using a popular word game as an ...
How to reverse engineer Android applications—using a popular word game as an ...How to reverse engineer Android applications—using a popular word game as an ...
How to reverse engineer Android applications—using a popular word game as an ...
 
The Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldThe Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote World
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
Using VPP and SRIO-V with Clear Containers
Using VPP and SRIO-V with Clear ContainersUsing VPP and SRIO-V with Clear Containers
Using VPP and SRIO-V with Clear Containers
 
Finding Xori: Malware Analysis Triage with Automated Disassembly
Finding Xori: Malware Analysis Triage with Automated DisassemblyFinding Xori: Malware Analysis Triage with Automated Disassembly
Finding Xori: Malware Analysis Triage with Automated Disassembly
 
App container rkt
App container rktApp container rkt
App container rkt
 
Linux kernel-rootkit-dev - Wonokaerun
Linux kernel-rootkit-dev - WonokaerunLinux kernel-rootkit-dev - Wonokaerun
Linux kernel-rootkit-dev - Wonokaerun
 
Spark Summit EU talk by Jorg Schad
Spark Summit EU talk by Jorg SchadSpark Summit EU talk by Jorg Schad
Spark Summit EU talk by Jorg Schad
 
Squash Those IoT Security Bugs with a Hardened System Profile
Squash Those IoT Security Bugs with a Hardened System ProfileSquash Those IoT Security Bugs with a Hardened System Profile
Squash Those IoT Security Bugs with a Hardened System Profile
 
PTK 1.0 official presentation
PTK 1.0 official presentationPTK 1.0 official presentation
PTK 1.0 official presentation
 
FortranCon2020: Highly Parallel Fortran and OpenACC Directives
FortranCon2020: Highly Parallel Fortran and OpenACC DirectivesFortranCon2020: Highly Parallel Fortran and OpenACC Directives
FortranCon2020: Highly Parallel Fortran and OpenACC Directives
 
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
From Zero To Production (NixOS, Erlang) @ Erlang Factory SF 2016
 
Chasing the Adder. A tale from the APT world...
Chasing the Adder. A tale from the APT world...Chasing the Adder. A tale from the APT world...
Chasing the Adder. A tale from the APT world...
 
Nodejs Intro Part One
Nodejs Intro Part OneNodejs Intro Part One
Nodejs Intro Part One
 

Último

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
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
 
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 educationjfdjdjcjdnsjd
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Último (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
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
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

You're Off the Hook: Blinding Security Software

  • 1. You’re Off the Hook: Blinding Security Software Alex Matrosov | Principal Research Scientist Jeff Tang | Senior Security Researcher
  • 2. Who We Are - Alex § Principal REsearch Scientist @CylanceInc § Previously @IntelSecurity / @ESET § Co-author of Rootkits and Bootkits: Reversing Modern Malware and Next Generation Threats § @matrosov @matrosov
  • 3. Who We Are - Jeff § Senior Security Researcher @CylanceInc § Formerly @VAHNA / @NSAGov § Hates computers – career dedicated to breaking computers § @mrjefftang @mrjefftang
  • 4. Overview § Why user-mode hooks? § Hooking Basics § Hooking Vulnerabilities (Captain Hook) § Control Flow Guard / Return Flow Guard § Universal Unhooking § Demo / Results
  • 5. Why user-mode hooking? § Kernel Patch Protection (KPP) a.k.a. “PatchGuard” § Introduced in 2005 for Windows 2003 SP1 x64 – multiple revisions since then § Prevents modification to the Windows kernel and kernel data structures § IDT, GDT, SSDT, MSR, System PE Images § Analysis and bypasses documented by various security researchers (skape, skywing) § Bypasses implemented by malware rootkits (Uroburos) § Incrementally updated to address deficiencies and block bypasses § Creates an arms race between independent software vendors (ISV) and Microsoft § Forces security vendors to rely on user-mode hooking in order to monitor processes for malicious behavior § http://blog.talosintel.com/2014/08/the-windows-81-kernel-patch-protection.html
  • 6. User-Mode Hooking Basics § IAT Hooking § Replace address of target function in IAT with address to a new function § Inline Hooking § Replaces the prologue of target functions with a jmp to a detour § Detour function calls a trampoline function § Trampoline function contains the function’s original prologue and jmp into the original function § Original function returns into detour § Detour returns to caller § http://jbremer.org/x86-api-hooking-demystified/
  • 9. Hooking Issues (Captain Hook) § Documented by the enSilo Research Team & presented at BlackHat US 2016 § Captain Hook: Pirating AVs to Bypass Exploit Mitigations § Discovered 6 classes of major vulnerabilities in user-mode hooking
  • 10. Hooking Issues (Captain Hook) https://www.blackhat.com/docs/us-16/materials/us-16-Yavo-Captain-Hook-Pirating-AVs-To-Bypass-Exploit-Mitigations.pdf
  • 11. Hooking Issues (Captain Hook) § Unsafe Injection § Predictable RWX (Universal) § Predictable RX § Predictable RWX (Windows 7 and below) § RWX Hook Code Stubs § RWX Hooked Modules https://www.blackhat.com/docs/us-16/materials/us-16-Yavo-Captain-Hook-Pirating-AVs-To-Bypass-Exploit-Mitigations.pdf
  • 12. Control Flow Guard (CFG) § Introduced with Windows 10 / Windows 8.1 Update 3 § Requires support from the compiler/linker and operating system § Compiler generates CFG instrumented binaries (/guard:cf) § Embeds a CFG Bitmap representing valid indirect call locations § Inserts _guard_check_icall before indirect calls § Operating system supports CFG at run time: § Supported OS maps guard check to ntdll!LdrpValidateUserCallTarget § Unsupported OS is just a simple ret § Not perfect, there are bypasses available § Functions left RWX by a hooking engine bypass CFG as they can be overwritten with shellcode
  • 13. Return Flow Guard (RFG) § Upcoming technology likely to be introduced in Windows 10 Creators Update § Protects return address by comparing it to the saved value on a shadow stack (fs:[rsp]) § Requires support from the compiler/linker and operating system § Compiler generates an RFG instrumented binary § Inserts no-op padding in function prologue and epilogues § Operating system supports RFG at run time: § Overwrites prologue with instructions to save return address to shadow stack § Overwrites epilogue with instructions to check return address against shadow stack § http://xlab.tencent.com/en/2016/11/02/return-flow-guard/
  • 16. Prior Work § Unhooking has been around for a long time § Generally relies on identifying specific hooking methods/signatures § Focuses in hooks installed in function prologues § https://breakdev.org/defeating-antivirus-real-time-protection-from-the-inside/ § In-memory RFG instrumented binaries will be different than on-disk – unhooking will remove the RFG prologue/epilogue patches § Endpoint detect & respond (EDR) products rely heavily on user-mode hooking for telemetry
  • 17. Universal Unhooking DLL § For each module in PEB_LDR_DATA->InMemoryOrderModuleList: ü Load the module from disk ü Allocate a new memory space of NtHeader->OptionalHeader.SizeOfImage ü Perform PE relocations based off original module base address ü Resolve Import Address Table (IAT) ü Compare our new copy with the original copy ü Copy over our pristine copy if changes are detected § Based off of Stephen Fewer’s Reflective DLL Injection code
  • 18. Universal Unhooking DLL - Loading § Load the file into memory ü CreateFile(“ntdll.dll”, …) ü CreateFileMapping(...) ü MapViewOfFile(...) ü <new base address> = VirtualAlloc(..., NtHeader->Optionalheader.SizeOfImage, …) § Copy PE sections into correct location in memory ü memcpy(<new base address> + SectionHeader->VirtualAddress, SectionHeader->PointerToRawData)
  • 19. Universal Unhooking DLL - Relocation § The normal relocation process adds an image delta to each relocation ü delta = loaded base address - OptionalHeader.ImageBase § Or it adds the high/low word of the delta depending on relocation type § Our unhooking code performs relocation with the loaded base address of the original loaded DLL ü delta = original base address - OptionalHeader.ImageBase § This gives us a binary copy of what the DLL looked like after being loaded but before being hooked
  • 20. Universal Unhooking DLL – Import Resolution § Need to resolve the import table without bringing in a hooked function § Custom GetProcAddress to parse the IMAGE_EXPORT_DIRECTORY of each module § Must support export forward descriptors and API Sets § A forward descriptor is a function that resolves to a virtual address within the IMAGE_EXPORT_DIRECTORY address space
  • 21. Universal Unhooking DLL – Import Resolution
  • 22. API Set Schema § Introduced in Windows 7 (v2) as part of project “MinWin” § Updated in Windows 8.1 (v4) and Windows 10 (v6) § Mapping of “Virtual DLLs” to “Logical DLLs” stored in apisetschema.dll § Very little documented information on API Set Schema § http://www.geoffchappell.com/studies/windows/win32/apisetschema/index.htm § http://blog.quarkslab.com/runtime-dll-name-resolution-apisetschema-part-i.html § http://blog.quarkslab.com/runtime-dll-name-resolution-apisetschema-part-ii.html
  • 23. API Set Schema - Example
  • 24. API Set Schema - Evolution
  • 26. Universal Unhooking DLL – Compare & Restore § Compare each PE section of the original loaded DLL to our version § Replace any sections which are different § Return back to initial program to continue execution without hooks
  • 27. Reflective DLL § The universal unhooking code is compiled as a reflective DLL § Meterpreter: post/windows/manage/reflective_dll_inject § Can be injected into everything!
  • 28. Meterpreter § Meterpreter server is already delivered as a Reflective DLL § Security software could detect Meterpreter initialization prior to unhooking § Solution: Modify meterpreter server to call unhooking code before connection initialization § Drop in replacement for Metasploit installs § Copy modified metsrv.dll to metasploit-framework/data/meterpreter/
  • 29. UPX § Why UPX? § It’s well known and open-source § Modify UPX to insert an extra section ‘UPX3’ containing arbitrary reflective DLL § UPX decoder stub unpacks original binary and resolves imports § Decoder calls the first export in the reflective DLL (ReflectiveLoader()) § Unhooking code runs and removes any hooks detected § Stub decoder jumps to original entry point (OEP) § Note: Reflective DLL is not compressed by UPX § Also blows up the size of the final packed executable
  • 30. UPX
  • 31. UPX § Final basic block of UPX stub decoder § call sub_5C46A0 – ReflectiveLoader() § jmp word_46E0E6 – Original Entry Point (OEP) § Note: On 64-bit platforms, rsp must be 16-bit aligned before the call to ReflectiveLoader()
  • 32. UPX § Problem: Once UPX unpacks binary into memory, it will be different compared to on disk copy – how does the unhooking code avoid reloading packed binary into memory?
  • 33. UPX § Unhooking code ignores any PE section with IMAGE_SCN_MEM_WRITE (0x80000000) § UPX marks every section as PEFL_WRITE == IMAGE_SCN_MEM_WRITE
  • 34. UPX
  • 35. Demo
  • 36. Results Software Result BitDefender Success - Bypassed Dr. Web Success - Bypassed ESET Blocked Kaspersky Blocked Symantec Success - Unaffected McAfee Success - Unaffected TrendMicro Success - Unaffected EMET Success - Unaffected
  • 38. Future Work § Improve UPX modifications to compress/pack the reflective DLL § Update ReflectiveLoader() to perform unhooking checks and repairs § Support for other packing software?
  • 39. Closing § User-mode hooking is fragile and easily bypassed § Relying on user-mode hooking for protection is ineffective § Critical need for OS support to provide callbacks and APIs for monitoring system behavior § Source code will be released soon @ https://github.com/CylanceVulnResearch/