Attacking Host Intrusion Prevention Systems. Eugene Tsyrklevich eugene@securityarchitects.com



Similar documents
Eugene Tsyrklevich. Ozone HIPS: Unbreakable Windows

Reverse Engineering and Computer Security

Bypassing Memory Protections: The Future of Exploitation

Title: Bugger The Debugger - Pre Interaction Debugger Code Execution

Hotpatching and the Rise of Third-Party Patches

Unix Security Technologies. Pete Markowsky <peterm[at] ccs.neu.edu>

Adjusting Prevention Policy Options Based on Prevention Events. Version 1.0 July 2006

VICE Catch the hookers! (Plus new rootkit techniques) Jamie Butler Greg Hoglund

Software Vulnerabilities

Inside Windows Rootkits

PuttyRider. With great power comes great responsibility. # Pivoting from Windows to Linux in a penetration test. Adrian Furtunã, PhD adif2k8@gmail.

Bypassing Windows Hardware-enforced Data Execution Prevention

Web Exploit Finder. Detecting Drive-By-Downloads in a virtualized environment. Benjamin Mack xnos Internet Services

OLD WIN32 CODE FOR A MODERN, SUPER-STEALTH TROJAN

Defense in Depth: Protecting Against Zero-Day Attacks

Custom Penetration Testing

Towards Automated Botnet Detection and Mitigation

API Monitoring System for Defeating Worms and Exploits in MS-Windows System

Automating Mimicry Attacks Using Static Binary Analysis

Format string exploitation on windows Using Immunity Debugger / Python. By Abysssec Inc

Syscall Proxying - Simulating remote execution Maximiliano Caceres <maximiliano.caceres@corest.com> Copyright 2002 CORE SECURITY TECHNOLOGIES

5 Steps to Advanced Threat Protection

For a 64-bit system. I - Presentation Of The Shellcode

DAWSON -- Synthetic Diversity for Intrusion Tolerance 1

DEFENSE THROUGHOUT THE VULNERABILITY LIFE CYCLE WITH ALERT LOGIC THREAT AND LOG MANAGER

Abstract. 1. Introduction. 2. Threat Model

Abysssec Research. 1) Advisory information. 2) Vulnerable version

Advanced Endpoint Protection Overview

Windows Rootkit Overview

The Value of Physical Memory for Incident Response

Exploitation of Windows 8 Metro Style Apps. The Subway Line 8. Ming-chieh Pan (Nanika) Sung-ting Tsai (TT)

Discovering passwords in the memory

Hi and welcome to the Microsoft Virtual Academy and

Bypassing Browser Memory Protections in Windows Vista

Stitching the Gadgets On the Ineffectiveness of Coarse-Grained Control-Flow Integrity Protection

Architecture Flaws Internet Security Systems. All rights reserved. Contents are property of Internet Security Systems.

Application Whitelisting - Extend your Security Arsenal? Mike Baldi Cyber Security Architect Honeywell Process Solutions

Host-based Intrusion Prevention System (HIPS)

Software security. Buffer overflow attacks SQL injections. Lecture 11 EIT060 Computer Security

International Journal of Computer Science and Network (IJCSN) Volume 1, Issue 5, October ISSN Bhopal, M.P.

Virtualization System Security

Host-based Intrusion Prevention on Windows and UNIX. Dr. Rich Murphey White Oak Labs

Mobile Application Threat Analysis

UNCLASSIFIED Version 1.0 May 2012

Hypervisor-Based, Hardware-Assisted System Monitoring

Modern Binary Exploitation Course Syllabus

SQL SERVER Anti-Forensics. Cesar Cerrudo

Hacking your perimeter. Social-Engineering. Not everyone needs to use zero. David Kennedy (ReL1K) Twitter: Dave_ReL1K

Vista and ActiveX control

INTRODUCTION TO MALWARE & MALWARE ANALYSIS

Online Payments Threats

Introduction. Application Security. Reasons For Reverse Engineering. This lecture. Java Byte Code

Hacking. The Edge Pieces. Ken Gottry May Ken Gottry

EMET 4.0 PKI MITIGATION. Neil Sikka DefCon 21

CEN 559 Selected Topics in Computer Engineering. Dr. Mostafa H. Dahshan KSU CCIS

Vulnerability-Focused Threat Detection: Protect Against the Unknown

Detecting Malware With Memory Forensics. Hal Pomeranz SANS Institute

Stealth Secrets of the Malware Ninjas. By Nick Harbour

How To Protect A Network From Attack From A Hacker (Hbss)

USM IT Security Council Guide for Security Event Logging. Version 1.1

Off-by-One exploitation tutorial

Hypervisor-based Intrusion Detection. Lionel Litty

Transparent ROP Detection using CPU Performance Counters. 他 山 之 石, 可 以 攻 玉 Stones from other hills may serve to polish jade

ERNW Newsletter 51 / September 2015

Practical Attacks against Mobile Device Management (MDM) Michael Shaulov, CEO Daniel Brodie, Security Researcher Lacoon Mobile Security

Virtual Machine Security

Detecting the One Percent: Advanced Targeted Malware Detection

SECURITY B-SIDES: ATLANTA STRATEGIC PENETRATION TESTING. Presented by: Dave Kennedy Eric Smith

Attacking x86 Windows Binaries by Jump Oriented Programming

A Comparison of Buffer Overflow Prevention Implementations and Weaknesses

International Journal of Enterprise Computing and Business Systems ISSN (Online) :

McAfee Deep Safe. Security beyond the OS. Kai-Ping Seidenschnur Senior Security Engineer. October 16, 2012

A Hypervisor IPS based on Hardware assisted Virtualization Technology

Windows Operating Systems. Basic Security

Deep Discovery. Technical details

LASTLINE WHITEPAPER. In-Depth Analysis of Malware

I Control Your Code Attack Vectors Through the Eyes of Software-based Fault Isolation. Mathias Payer, ETH Zurich

CORE SECURITY. Exploiting Adobe Flash Player in the era of Control Flow Guard. Francisco Falcon Black Hat Europe 2015 November 12-13, 2015

Linux Kernel. Security Report

Practical taint analysis for protecting buggy binaries

CS52600: Information Security

Security. Definitions

Subverting the Xen hypervisor

Microsoft Windows: A lower Total Cost of 0wnership

Network Threats and Vulnerabilities. Ed Crowley

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering

Certified Cyber Security Expert V Web Application Development

Exploiting nginx chunked overflow bug, the undisclosed attack vector

Ed Ferrara, MSIA, CISSP Fox School of Business

Security: Attack and Defense

Advanced Windows Firewall Subversion. Lin0xx of NoxusFiles

What is Next Generation Endpoint Protection?

2. From a control perspective, the PRIMARY objective of classifying information assets is to:

Persistence Mechanisms as Indicators of Compromise

Thick Client Application Security

Top five strategies for combating modern threats Is anti-virus dead?

Penetration Test Methodology on Information-Security Product Utilizing the Virtualization Technology

The Sandbox Roulette: are you ready to gamble? Rafal Wojtczuk Rahul Kashyap

Sandy. The Malicious Exploit Analysis. Static Analysis and Dynamic exploit analysis. Garage4Hackers

Transcription:

Attacking Host Intrusion Prevention Systems Eugene Tsyrklevich eugene@securityarchitects.com

Agenda Introduction to HIPS Buffer Overflow Protection Operating System Protection Conclusions Demonstration

Introduction to HIPS Host Intrusion Prevention Systems are deployed on the end hosts Should protect against buffer overflows Should protect the underlying operating system Should protect against known and unknown attacks

Attack Scenario Stage 1 The first step in a typical attack involves gaining remote access to a system Usually achieved by means of a remote buffer overflow HIPS solution: buffer overflow protection

Attack Scenario Stage 2 Once remote access is gained, attackers usually clean the logs, trojan the system and install rootkits Achieved by tampering with system logs and binaries and by loading unauthorized malicious code HIPS solution: disallow tampering with system files and registry keys and disallow loading of unauthorized code

In reality Buffer overflow protection can be trivially bypassed System files and registry keys can be modified And kernel code can still be loaded

Buffer Overflow Protection The majority of existing buffer overflow protection solutions do not actually prevent buffer overflows Instead they try to detect when shellcode (attacker s code) begins to execute

Buffer Overflow Protection (2) Shellcode detection works by checking whether code is running from a writable page (i.e. stack or heap) Shellcode detection can be implemented in Userland or Kernel

Win32 Example application kernel32.dll ntdll.dll kernel shel l code hooks hooks hooks

Win32 Userland Buffer Overflow Protection Code LoadLibraryA: // original function preamble is overwritten by HIPS jmp Kernel32SampleBufferOverflowProtectionHook : void Kernel32SampleBufferOverflowProtectionHook() { // retrieve the return address from stack _asm mov ReturnAddress, [esp] if (IsAddressOnWritablePage( ReturnAddress )) LogAndTerminateProcess(); ReturnToTheHookedAPI();

Bypassing Userland Hooks application kernel32.dll ntdll.dll kernel shellcode hooks It is possible to bypass kernel32.dll hooks and call other entry points directly!

Bypassing Userland Hooks Example Normal shellcode void shellcode() { LoadLibrary( library.dll ); // call kernel32.dll which } // will eventually call ntdll.dll Stealth shellcode void shellcode() { } LdrLoadDll( library.dll ); // call ntdll.dll directly

Attacking Userland Hooks Userland hooks run with the same privileges as the shellcode Therefore, shellcode, in addition to simply bypassing the hooks, can attack the protection mechanism directly This applies not only to buffer overflow protection but also to all security mechanisms implemented in userland

Attacking Userland Hooks Example void shellcode() { // bypass GetProcAddress() hook LoadLibraryAddress = ShellCodeCopyOfGetProcAddress("LoadLibraryA"); // overwrite LoadLibraryA() hook with the original function preamble memcpy(loadlibraryaddress, LoadLibraryAPreamble, 5); } // call cleansed LoadLibrary() LoadLibraryAddress();

Bypassing Kernel Hooks application kernel32.dll ntdll.dll kernel? shellcode f a k e hooks Create a fake stack frame without the EBP register and with a return address pointing to a non-writable segment

Bypassing Kernel Hooks Example // LoadLibrary( library.dll ) push real_return_address push library.dll // fake a call LoadLibrary call with a fake return address push ret_instruction_in_readonly_segment jmp LoadLibrary real_return_address: : ret_instruction_in_readonly_segment: ret

Bypassing Kernel Hooks Example (2)

Buffer Overflow Protection Summary Hard to implement in a secure manner Even harder to implement on a closed source operating system The majority of buffer overflow protection solutions are simply designed to detect shellcode Can be easily bypassed by attackers

Operating System Protection Operating system protection involves protecting the integrity of system files and registry keys Operating system protection also disallows the loading of arbitrary code Similar to buffer overflow protection, operating system protection can be implemented in Userland or Kernel

Userland OS Protection Userland protection code runs with the same privileges as the shellcode Win32 SAFER appears to be implemented this way Completely ineffective against malicious code that has already begun to execute

Kernel OS Protection Kernel code runs with different privileges than userland Has complete control over the entire system Hard to attack directly But can still be evaded (if not implemented properly)

Bypassing Operating System Protection Some HIPS implementations can be completely bypassed by using symbolic links HIPS might be protecting c:\windows\system32\drivers\* But is it protecting x:\drivers\*?

Bypassing Operating System Protection Example

Bypassing Operating System Protection (2) Alternatively, HIPS might be protecting \Registry\Machine\System\* But is it protecting \MyRegistryMachine\System\*? NtCreateSymbolicLinkObject() can be used to create symbolic links in kernel namespace

Bypassing Operating System Protection Example (2) \MyRegistryMachine\System = \Registry\Machine\System.

Kernel Code Loading Interfaces A well-known and well understood interface: Service Control Manager (SCM) API A less known interface: ZwLoadDriver() A little known interface: ZwSetSystemInformation() SystemLoadAndCallImage SystemLoadImage

Bypassing Kernel Code Loading Restriction Use a little known interface such as ZwSetSystemInformation() Inject code by directly modifying kernel memory (\Device\PhysicalMemory or is it \MyPhysicalMemory? :) Exploit a kernel overflow

Bypassing Kernel Code Loading Restriction If a trusted system process is still allowed to load kernel drivers, use DLL injection to inject userland code into the trusted process and then load a malicious kernel driver Modify an existing kernel driver on disk

Operating System Protection Summary HIPS are designed to protect operating system files and registry keys, as well as to disallow the loading of unauthorized code. Similar to buffer overflow protection, userland based implementations cannot protect against malicious code that is executing with the same privileges Kernel based implementations are a lot more robust, but can still be evaded by modifying different system namespaces

Conclusion HIPS technology has a promising future There are a lot of attack vectors and missing just one could completely compromise the security and integrity of the system The majority of current HIPS implementations suffer from a variety of security flaws The technology needs time to mature

Thank You Thanks! http://www.securityarchitects.com/ eugene@securityarchitects.com

Live Demo Demonstration