Defense in Depth: Protecting Against Zero-Day Attacks



Similar documents
Bypassing Memory Protections: The Future of Exploitation

Modern Binary Exploitation Course Syllabus

Software Vulnerabilities

Unix Security Technologies: Host Security Tools. Peter Markowsky <peterm[at]ccs.neu.edu>

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

Eugene Tsyrklevich. Ozone HIPS: Unbreakable Windows

Custom Penetration Testing

Bypassing Windows Hardware-enforced Data Execution Prevention

Buffer Overflows. Code Security: Buffer Overflows. Buffer Overflows are everywhere. 13 Buffer Overflow 12 Nov 2015

Bypassing Browser Memory Protections in Windows Vista

Secure Web Application Coding Team Introductory Meeting December 1, :00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda

Attacking Host Intrusion Prevention Systems. Eugene Tsyrklevich

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

Safety measures in Linux

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

Application Intrusion Detection

Denial of Service (DoS) Technical Primer

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

Chapter 15 Operating System Security

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

How to Sandbox IIS Automatically without 0 False Positive and Negative

Where s the FEEB? The Effectiveness of Instruction Set Randomization

CVE Adobe Flash Player Integer Overflow Vulnerability Analysis

============================================================= =============================================================

Advanced IBM AIX Heap Exploitation. Tim Shelton V.P. Research & Development HAWK Network Defense, Inc. tshelton@hawkdefense.com

The Leader in Cloud Security SECURITY ADVISORY

Sandbox Roulette: Are you ready for the gamble?

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

Red Hat. By Karl Wirth

0days: How hacking really works. V 1.0 Jan 29, 2005 Dave Aitel dave@immunitysec.com

Security for Mac Computers in the Enterprise

Kernel Intrusion Detection System

Evading Infrastructure Security Mohamed Bedewi Penetration Testing Consultant

Cataloguing and Avoiding the Buffer Overflow Attacks in Network Operating Systems

How to build and use a Honeypot. Ralph Edward Sutton, Jr. DTEC 6873 Section 01

noway.toonux.com 09 January 2014

Security: Attack and Defense

Introduction to Information Security

CS 558 Internet Systems and Technologies

TECHNICAL NOTE 08/04 IINTRODUCTION TO VULNERABILITY ASSESSMENT TOOLS

90% of data breaches are caused by software vulnerabilities.

Locking down a Hitachi ID Suite server

Programming Flaws and How to Fix Them

EECS 354 Network Security. Introduction

Windows XP SP3 Registry Handling Buffer Overflow

FINAL DoIT v.4 PAYMENT CARD INDUSTRY DATA SECURITY STANDARDS APPLICATION DEVELOPMENT AND MAINTENANCE PROCEDURES

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

MWR InfoSecurity Advisory. Interwoven Worksite ActiveX Control Remote Code Execution. 10 th March Contents

Analysis of the Linux Audit System 1

Integrated Network Vulnerability Scanning & Penetration Testing SAINTcorporation.com

MSc Computer Science Dissertation

Advanced Endpoint Protection Overview

Using Palo Alto Networks to Protect Microsoft SharePoint Deployments

Put a Firewall in Your JVM Securing Java Applications!

Threat Intelligence Pty Ltd Specialist Security Training Catalogue

ASL IT SECURITY XTREME XPLOIT DEVELOPMENT

Cyber Security In High-Performance Computing Environment Prakashan Korambath Institute for Digital Research and Education, UCLA July 17, 2014

Software Vulnerability Exploitation Trends. Exploring the impact of software mitigations on patterns of vulnerability exploitation

Intro to Patching. Thomas Cameron, Chief Architect, Western US, Red Hat twitter: thomasdcameron IRC: choirboy on Freenode

Hotpatching and the Rise of Third-Party Patches

Guidelines for Website Security and Security Counter Measures for e-e Governance Project

Stephen Coty Director, Threat Research

Reverse Engineering and Computer Security

What is Web Security? Motivation

This session was presented by Jim Stickley of TraceSecurity on Wednesday, October 23 rd at the Cyber Security Summit.

Testing Web Applications for SQL Injection Sam Shober

Software Vulnerability Assessment

Potential Targets - Field Devices

X05. An Overview of Source Code Scanning Tools. Loulwa Salem. Las Vegas, NV. IBM Corporation IBM System p, AIX 5L & Linux Technical University

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

1 hours, 30 minutes, 38 seconds Heavy scan. All scanned network resources. Copyright 2001, FTP access obtained

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

ivos Technical Requirements V For Current Clients as of June 2014

CSC 405 Introduction to Computer Security

Today s Topics. Protect - Detect - Respond A Security-First Strategy. HCCA Compliance Institute April 27, Concepts.

Penetration Testing. NTS330 Unit 1 Penetration V1.0. February 20, Juan Ortega. Juan Ortega, juaorteg@uat.edu. 1 Juan Ortega, juaorteg@uat.

Last update: February 23, 2004

ERNW Newsletter 51 / September 2015

Using a Patched Vulnerability to Bypass Windows 8 x64 Driver Signature Enforcement. MJ0011 th_decoder@126.com

Bug hunting. Vulnerability finding methods in Windows 32 environments compared. FX of Phenoelit

A Decision Maker s Guide to Securing an IT Infrastructure

CS5008: Internet Computing

Windows Remote Access

Betriebssysteme KU Security

Virtualization System Security

Transcription:

Defense in Depth: Protecting Against Zero-Day Attacks Chris McNab FIRST 16, Budapest 2004

Agenda Exploits through the ages Discussion of stack and heap overflows Common attack behavior Defense in depth overview Kernel modifications PaX Q & A

Introduction Who is Chris McNab? Technical Director of Matta Consulting, a London-based security services company providing training and assessment services to numerous large clients Author of Network Security Assessment

Exploits Through the Ages Started out really simple PHF and other logic flaws back in 1994 In 1996 the first buffer overflow was posted to BugTraq Stack overflows were all the rage (1996 onwards) Return address (aka. saved EIP) overwritten Evil assembler placed on the stack (aka. shellcode) Easy to exploit reliably (most worms are stack overflows) In 2004 these are become increasingly rare Heap overflows came next (1998 onwards) Since 1998 numerous heap overflows have been found Trickier to exploit reliably (no known heap worms)

Exploits Through the Ages Then Stack Off-by-one bugs (2000 to present) The German group TESO pioneered this attack Numerous bugs identified, mainly in open source code.. And don t forget Format String bugs (2001 to present) Easy to identify and exploit Abuses features of functions like printf() and syslog().. Or Integer overflows (2001 to present) Integer overflows are technically a delivery mechanism resulting in a stack or heap overflow through code expecting a number of a certain size, and instead getting a larger number, or one that is negative. Integer overflows are complex to identify and exploit

Runtime Memory Layout The Stack is used to store local function variables of a known size, such as answers to questions, flags and other manageable data. The stack grows downwards to lower memory addresses as more data is placed on it Space is allocated on the heap dynamically when the size of the data to be stored isn t necessarily known. The heap represents the largest region of memory for most processes BSS and Data segments are used to store global data that is set at runtime, such as authentication flags or permissions The text segment contains the executable code and libraries for the program. The text is not written to during runtime

Processor Registers

The Hacking Concept Hacking is the art of manipulating a process so that it performs an action that is useful to you By overwriting important values on the stack or heap, we can influence logical program flow, and often execute code I will now discuss stack and heap overflows..

Using the Stack Legitimately

Overflowing the Stack

Doing Something Useful

What About the Heap? The Heap is Very Different Depending on the Platform Linux (glibc) AIX BSD Windows Oracle and others use their own heap implementations Heap Exploitation and Issues Heap exploitation requires a lot of research Many heap exploits use brute forcing of addresses Difficult to turn into worms

Examples of IIS Overflows MSW3PRT.DLL Overflow (aka. The.printer bug) CVE-2001-0241 GET /NULL.printer HTTP/1.1 Blah: [shellcode] Host: [ C x 420 ][Address of shellcode]

Examples of IIS Overflows IDQ.DLL Overflow (aka. The Code Red bug) CVE-2001-0500 GET /default.ida?[c x 240]=x HTTP/1.1 Host: www.example.org Blah: [C x 10,000][shellcode]

Examples of IIS Overflows NTDLL.DLL Overflow (aka. The WebDAV bug) CVE-2003-0109 SEARCH /[Address of shellcode x 300] HTTP/1.1 Host: www.example.org Content-Type: text/xml Content-Length: 480 <?xml version="1.0"?> <g:searchrequest xmlns:g="dav:"> <g:sql> Select "DAV:displayname" from scope() </g:sql> </g:searchrequest> 0x01 [shellcode]

Common Attack Behavior Network Activity A malformed request (HTTP, FTP, et al) Usually long arguments and variables are provided Request contains shellcode if an overflow is being abused Watch out for NOP-sleds (\x90\x90\x90\x90\x90\x90\x90) Host Activity A pointer is overwritten in memory, changing logical program flow (stack frame variables, heap control structures, structured exception handlers, et al) Shellcode is executed from the stack or heap, or.. Suspicious system calls are made (system(), socket())

Defense in Depth Overview We can use this behavior to pick up on zero-day attacks before they reach vulnerable components: Network monitoring and analysis firewalls and IDS Server-based sanitizing of traffic Microsoft URLScan We also use local kernel modifications to protect logical program flow, even if vulnerable code exists: Canary values in memory to prevent overflows Non-executable stack and heap Randomization of library system calls, GOT, PLT entries

Basic Kernel Modifications Stack & Heap Protection Canary values to prevent clobbering of sensitive variables Non-executable stack and heap, preventing shellcode from being executed from the stack or heap Windows 2003 Server, XP SP2, OpenBSD, and Linux systems running kernel patches such as OpenWall.. These mechanisms can be easily bypassed if an attacker has local access, by using overwriting function pointers and calling functions in common loaded libraries (such as system()) to compromise the system. Remote bypass is more tricky, but not impossible..

Kernel Modifications Non-executable stack and heap are not enough!! Windows 2003 canary values and non-executable stack can be bypassed. See David Litchfield s paper at: http://www.nextgenss.com/papers/defeating-w2k3-stack-protection.pdf Need to prevent sensitive data on the stack from being overwritten and processed, as function pointers and exception handlers can be overwritten and result in code execution, even with canaries and non-exec stack/heap PaX (a Linux kernel patch), along with randomization of regions of memory, deals with this very well, protecting server processes from remote attack at least.

PaX Without SEGMEXEC User Code & Data Segments 3GB With SEGMEXEC User Code Segment 1.5GB User Data Segment 1.5GB PaX uses a feature known as SEGMEXEC to mirror executable memory pages. Before the executable pages are fetched by the processor, they are matched to those in the other segment, to ensure validity.

PaX Continued.. Other features include: KERNEXEC, preventing kernel exploitation Randomization of everything: Stack Heap Library and executable images It is impossible to execute arbitrary code in either user or kernel space if PaX is installed Software is still exploitable locally, through ret-to-libc attacks and guessing a 32-bit randomized address of a useful syscall (such as system())

The Future Microsoft and others are behind Non-exec stack and heap do not end overflows Locally launched attacks are still successful Linux has had non-exec patches for 6 years, Windows 2003 Server and XP SP2 just got theirs.. Free trusted computing is here now.. GRSec patches (www.grsecurity.net) SELinux (www.nsa.gov/selinux/)

Thank you all for coming! Questions? chris.mcnab@trustmatta.com www.trustmatta.com