1 / 38

Countering Kernel Rootkits with Lightweight Hook Protection

Countering Kernel Rootkits with Lightweight Hook Protection. Presented by: Ruaa Abdulrahman CAP 6135 .. Malware and Software Vulnerability Analysis April 08, 2013. Information. Authors: North Carolina State University Zhi Wang Xuxian Jiang Peng Ning Microsoft Research

chars
Download Presentation

Countering Kernel Rootkits with Lightweight Hook Protection

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Countering Kernel Rootkits with Lightweight Hook Protection Presented by: RuaaAbdulrahman CAP 6135 .. Malware and Software Vulnerability Analysis April 08, 2013

  2. Information • Authors: • North Carolina State University • Zhi Wang • Xuxian Jiang • PengNing • Microsoft Research • Weidong Cui • Published at: CCS '09 Proceedings of the 16th ACM conference on Computer and communications security, Chicago, Illinois, USA, 2009 • Sponsored by: NSF 0852131, 0855297, 0855036, and 0910767

  3. Kernel rootkits it’s one of the most stealthy computer malware and poses significant security threats. Why ? • its directly subverting OS kernel, not just hide their response, but also tamper with OS functionalities to launch various attack like: - opining system backdoors. - Stealing privet information. - Escalating privileges of malicious processes. - Disabling defense mechanisms.

  4. Kernel rootkits Equally important Because all of that threats : we need ? • Preservation of kernel code integrity. • Safeguard relevant kernel control data which are the return addresses and function pointers. • In this paper they focused on function pointers and called it“kernel hook”.

  5. Kernel Hook kernel hook == Function Pointer • Intuitively, to safeguard kernel hooks , we need to monitor and verify any write access to the memory page with kernel hook . • This approach has two conditions to work well: 1- There existing a very limited number of kernel hooks for protection. 2-These hooks are not co- located together with frequently modified memory data.

  6. Kernel Hook • Unfortunately ,these two conditions do not work with OS like Linux and windows because: • These OS may have thousands of kernel hook “not limited number” • and it can be widely scattered across the kernel space . • The solution for the above challenges:: ”Hooksafe”.

  7. Problem overview hijack control data subvert control data • Kernel rootkit : two types: - Kernel Object Hooking (KOH). - Dynamic Kernel Object Manipulation (DKOM) • They focused (KOH) because it is more common attack. • KOH can hijack code hook or data hook.

  8. Problem overview • Hijacking a kernel code hook: is easier to protect because its require modifying the kernel text section which is - usually static and - can be marked as read-only. • Kernel data hooks are function pointers and usually reside in two main kernel memory regions: - Preallocated memory areas including the data sections. - The dynamically allocated areas such as Kernel heap.

  9. Problem overview • Kernel data hooks are function pointers and usually reside in two main kernel memory regions: - Preallocated memory areas including the data sections. - The dynamically allocated areas such as Kernel heap. The aim is to protect the kernal hooks in both memorie regions to be tampered by a KernalrootKits.

  10. Problem overview • Protection granularity gap Challenge • Efficient Hook protection requires byte - level granularity. • BUT .. Hardware only provides page level protection • AND .. Since kernal hooks are scattered across the kernal space and often co-located with other dynamic kernal data, • SO .. we can not simply use hardware-based page level protection.

  11. Problem overview • Experiment .. - They analyzed a typical Ubuntu 8.04 server using a whole emulator called QEMU. - They used 5881 Linux Kernal Hooks. - They found that these Kernal hooks are scattered across 41 Pages and some of them located in dynamic kernal heap.

  12. Problem overview

  13. Problem overview • What are Pages? • Non-continuous memory blocks • Creates a mapping between a physical address and a virtual ones • Provides virtual RAM

  14. Hooksafe • Hooksafe is a hypervisor-based lightweight system that able to efficiently protect thousands of kernel hooks in a guest OS from being hijacked • “In computing, a hypervisor, also called virtual machine monitor (VMM), is one of many virtualization techniques which allow multiple operating systems, termed guests, to run concurrently on a host computer, a feature called hardware virtualization.”Wikipedia

  15. Hooksafe Design • Assumptions: • A hypervisor will be used to monitor virtual machines - A bootstrap like tboot exists to establish a static root of trust of the system • A hypervisor can be securely loaded • Protect the kernel at boot time - Runtime integrity of hypervisor is maintained

  16. Hooksafedesign • In order to resolve the protection granularity gap problem, • They Relocate kernel hooks to a dedicate page- aligned memory space. • Introduce thin hook indirection layer to regulate accesses to them with hardware based page level protection. • They created a shadow copy of the kernel hooks in a centralized location. Any attempt to modify the shadow copy will be trapped and verified by the underlying hypervisor .

  17. Hooksafe design • All read and Write accesses to protected Kernal hooks are routed through the hook indirection layer. • Only hypervisor can write to the memory pages of protected kernel, • In read access they use piece of indirection code residing in the guest OS kernel memory to read corresponding shadow hook.

  18. Hooksafe design • Hooksafe achieves its functionality in two steps: 1- Offline hook profiles 2- On line hook protector

  19. Offline hook profiles • it is a component that profiles the guest kernel execution and outputs a hook access profile for each protected hook. • Hook access profile will be used to enable transparent hook indirection. • Kernalinstructions that read or write to a hook called Hook Access Points (HAPs).

  20. Offline hook profiles - For the Design .. There are two approaches: 1- Static analysis • performed on OS kernel source code, • Utilize known program analysis technique to automatically collect hook access profile. • More complete, but less precise. • 2- Dynamic analysis • Doesn’t need OS kernel source code, • run the target system on the top of an emulator and monitor every memory access to derive the hook access instruction. • Allow for recording precise runtime information, but less coverage • HookSafe chooses Precision (Dynamic) over Coverage (Static)

  21. Offline hook profiles - Implementation • It is based on an open source whole system emulator( QEMU). • QEMU uses binary translation technique which rewrites guest’s binary instruction. • Then records executions of instructions that read or write memories. • If instruction accesses any kernel hook it is recorded as HAP and the value. • At the end, collected HAP instructions and values will be compiled as corresponding hook access profile.

  22. Online hook protector • Its input is the Hook Access Profile. • Creates a shadow copy of all protected hooks • Instruments HAP instructions such that their accesses will be transparently redirected to the shadow copy. • Shadow copies are moved into a centralized location to be protected from unauthorized modifications and kernel rootkits. (i.e. page level protection).

  23. Online hook protector • For the Design .. There are Three Processes : • Initialization: 1. Uses a short-lived kernel module (temporary) to create shadow copy of kernel hooks and load the code for indirection layer. 2. Use the online patching that provided by the hypervisor in order to instrument HAPs in guest kernel.

  24. Online hook protector • Run-Time Read/Write Indirection • Read Access: reads from the shadow hook copy and returns to HAP site. • Write Access: indirection layer issues hyper call and transfers control to hypervisor for validation check. Memory protection component validates write request and update shadow hook.

  25. Online hook protector • Run-Time Tracking of Dynamically Allocated Hooks • Dynamically Allocated Hooks is embedded in Dynamic Kernel Object (i.e. heap). • If one such kernel object is being allocated, a hypercall will be issued to HookSafe to create a shadow copy of the hook • Another hypercall is triggered to remove the shadow copy when kernel object is released.

  26. Online hook protector - Implementation • It is developed based on Xen Hypervisor. • Hypervisor replaces the HAP instruction at runtime with jmp instruction to allow execution flow to trampoline code in Hook indirection layer. • Trampoline code collects runtime info which is used by hook redirector to determine exact kernel hook being accessed. • After hook redirector processes the actual read or write on shadow hook, trampoline executes HAP specific overwritten instruction, if any, before returning to original program.

  27. Online hook protector

  28. Online hook protector

  29. memory protection • In order to protect the guest kernel code and the in-guest memory used by hooksafe. • the hypervisor maintains an SPT for each guest, which regulate the translation directly from a guest virtual address to the host physical address. • Any update in the guest page table GPT in the guest kernel is trapped and propagated to the SPT shadow page table by the hypervisor.

  30. Evaluation • In order to evaluate HookSafe’s effectiveness in preventing real-world rootkits, They used the Xen Hypervisor (version 3.3.o) to protect more than 5900 kernel hooks in Ubuntu8.04 Linux system. • There experiments with nine real-world rootkits show that Hooksafecan effectively defeat these nine rootkits attempt to hijack kernal hooks that are being protected. • It prevented all of nine rootkitsfrom modifying protected hooks and hiding themselves. • This large scale protection is achieved with only 6% slow down in system performance.

  31. Evaluation

  32. Conclusion • HookSafeis a hypervisor-based lightweight system that can protect thousands of kernel hooks from being hijacked by Kernel rootkits. • HookSafe overcomes a critical challenge of Protection Granularity Gap by introducing a thin hook indirection layer. • Experimental result with nine real-world rootkits show HookSafe is effective in defeating their hijacking attempts with only 6% performance overhead.

  33. Strengths • Rootkit protection is performed without the need of going to the source code (Dynamic Analysis) • Low overhead of 6% of runtime • Works with variable instruction length architecture (e.g. x86) • Perform byte equivalent protection by using page protection of the hypervisor.

  34. Weakness • Doesn’t record what caused the rootkit infection. It can detect, but not defend against future attempts. • When discrepancy is found it automatically assumes the original hook was compromised. • Memory usage for creating shadow copies

  35. Suggestions • Test HookSafe on Windows • Instead of checking discrepancy between hooks and their copy, check against a hash value to find out which is compromised • Incorporate static analysis or broader dynamic analysis (e.g. adaptive analysis)

  36. References • Z. Wang, X. Jiang, W. Cui, and P. Ning, “Countering kernel rootkits with lightweight hook protection”, Proceedings of the 16th ACM conference on Computer and communications security, Chicago, Illinois, USA, 2009, pp. 545 – 554 • http://www.wikipedia.org

  37. QUESTIONS

More Related