33
Saturday, May 17, 2008 Generating signatures for zero-day network attacks Pascal Gamper Daniela Brauckhoff Bernhard Tellenbach

Saturday, May 17, 2008 Generating signatures for zero-day network attacks Pascal Gamper Daniela Brauckhoff Bernhard Tellenbach

Embed Size (px)

Citation preview

Saturday, May 17, 2008

Generating signatures for zero-day network attacks

Pascal Gamper

Daniela Brauckhoff

Bernhard Tellenbach

2Saturday, May 17, 2008 Pascal Gamper

Outline

Motivation

Problem Statement

Automated Signature Generation – Overview

The NoAH approach Attack Detection Attack Analysis Signature Generation

3Saturday, May 17, 2008 Pascal Gamper

Motivation: The dynamics of (In)security

Source: “The Dynamics of (In)Security“, Stefan Frei, ETH Zurich, BlackHat 2006

90 % probability for available 0-day exploits

4Saturday, May 17, 2008 Pascal Gamper

Problem Statement

Defending against 0-day attacks: Intrusion Detection System (IDS) Separate benign and malicious network traffic Host- or Network-based signatures Most signatures for IDS are hand-craftet by

professionals Zero-day exploits make manual signature generation

useless

Problem: Manual signature generation is too slow! Options?

5Saturday, May 17, 2008 Pascal Gamper

Techniques for automated signature generation

Overview

6Saturday, May 17, 2008 Pascal Gamper

Building Blocks of an ASG System

AttackDetector

AnalysisEngine

Correlator

AttackDetector

AnalysisEngine

Site 1

Site N

raw data

SignatureGenerator

refined attack vector information

attack vector information

transformed attack vector information

7Saturday, May 17, 2008 Pascal Gamper

The NoAH Approach

EU Project NoAH (Network of Affined Honeypots)

8Saturday, May 17, 2008 Pascal Gamper

Goals

NoAH aims at automated detection of unknown attacks generation of signatures to counter 0-day attacks

Generate signatures for common IDS

Install full-scale infrastructure across Europe

Target audience: ISP‘s, NREN‘s, researchers

9Saturday, May 17, 2008 Pascal Gamper

Attack Detection

10Saturday, May 17, 2008 Pascal Gamper

NoAH Architecture: Attack Detector Argos

Detection technique (Argos): OS independent memory tainting (x86 emulator)

> Scope of NoAH: Remote attacks that do not require a human in the loop

Host OS

Emulated Hardware

Guest OS

RAM

0xAAANIC

CPU

NetworkNetwork

Exec

11Saturday, May 17, 2008 Pascal Gamper

Attack Analysis

12Saturday, May 17, 2008 Pascal Gamper

Combining Analysis Engines

Different analysis engines (Extractors) which Analyse attack information from different sources

Extractors can depend on each other

Meta-signature describes entire set of available attack information

Quality estimation of meta-signature based on Which extractors succeeded Value and amount of extracted information

13Saturday, May 17, 2008 Pascal Gamper

Combining host- and network-based analysis

Extractor #1: Host-based information from Argos

Identifies memory content relevant for the attack Identifies OS and attacked process Identifies network traffic bytes involved

Extractor #2: Network-based information from Protocol State Tracker

Protocol field(s) containing network bytes involved Communication/Protocol state history

14Saturday, May 17, 2008 Pascal Gamper

Basic Architecture of the entire ASG System

Honeypot

Network Protocol State

Tracker

MySQL Database

Signature Generator

Main process

Snitch Thread

Argos.netlog

Argos.csi.x

Network

Network

Socket

IPC

File I/O

Network

Network

TrackerOutput.dat

TrackerDump.dat

SnitchPerl Script

ArgosControl Socket

Extractor Thread

Argos Extractor

Tracker Extractor

15Saturday, May 17, 2008 Pascal Gamper

Basic Architecture of the entire ASG System

Honeypot

Network Protocol State

Tracker

MySQL Database

Signature Generator

Main process

Snitch Thread

Argos.netlog

Argos.csi.x

Network

Network

Socket

IPC

File I/O

Network

Network

TrackerOutput.dat

TrackerDump.dat

SnitchPerl Script

ArgosControl Socket

Extractor Thread

Argos Extractor

Tracker Extractor

16Saturday, May 17, 2008 Pascal Gamper

Basic Architecture of the entire ASG System

Honeypot

Network Protocol State

Tracker

MySQL Database

Signature Generator

Main process

Snitch Thread

Argos.netlog

Argos.csi.x

Network

Network

Socket

IPC

File I/O

Network

Network

TrackerOutput.dat

TrackerDump.dat

SnitchPerl Script

ArgosControl Socket

Extractor Thread

Argos Extractor

Tracker Extractor

17Saturday, May 17, 2008 Pascal Gamper

Basic Architecture of the entire ASG System

Honeypot

Network Protocol State

Tracker

MySQL Database

Signature Generator

Main process

Snitch Thread

Argos.netlog

Argos.csi.x

Network

Network

Socket

IPC

File I/O

Network

Network

TrackerOutput.dat

TrackerDump.dat

SnitchPerl Script

ArgosControl Socket

Extractor Thread

Argos Extractor

Tracker Extractor

18Saturday, May 17, 2008 Pascal Gamper

Basic Architecture of the entire ASG System

Honeypot

Network Protocol State

Tracker

MySQL Database

Signature Generator

Main process

Snitch Thread

Network

Network

Socket

IPC

File I/O

Network

Network

TrackerOutput.dat

TrackerDump.dat

SnitchPerl Script

ArgosControl Socket

Extractor Thread

Tracker Extractor

Argos.netlog

Argos.csi.x

Argos Extractor

19Saturday, May 17, 2008 Pascal Gamper

Basic Architecture of the entire ASG System

Honeypot

Network Protocol State

Tracker

Database

Signature Generator

Main process

Snitch Thread

Network

Network

Socket

IPC

File I/O

Network

Network

SnitchPerl Script

ArgosControl Socket

Extractor Thread

Argos.netlog

Argos.csi.x

Argos Extractor

Meta-signature

TrackerOutput.dat

TrackerDump.dat

Tracker Extractor

20Saturday, May 17, 2008 Pascal Gamper

Network Protocol State Tracker

Tracks the network connections towards one or more honeypot systems

Logs protocol states for each packet User-defined packet and connection analysis

possible Is highly configurable by relying on various

libraries State machine configurations currently available

for IP, TCP/UDP, FTP

21Saturday, May 17, 2008 Pascal Gamper

Libraries

NetBee library Developed by NetGroup at Politecnico di Torino Components for different types of packet processing We integrated Packet Decoding functionality into Tracker

Netprotofsm Finite state machine library for describing network protocols Our approach is based on work by J. van Gurp and J. Bosch Features:

- Protocol state machines defined by XML files

- Resource-gentle

- Flexible timer mechanism (schedule events, define timeouts)

- Implement custom actions

22Saturday, May 17, 2008 Pascal Gamper

Architecture

State Machine(libnetprotofsm)

Network

Network

Network

Network

LogActionReplayActio

n

Connection State Log File

EventData

LogReader

PacketDecoder

Connection State Log File

Replayer

Capturing

Protocol Specification File

Network

Network

Pcap library

NetBee library

netprotofsm library

ReplayerState Tracker

23Saturday, May 17, 2008 Pascal Gamper

Example: Attack information extracted

InformationMemory Dump

Argos INetwork PacketExtractor #2

Protocol Connection State:TCP: Connection establishedFTP: Login, User identification 04 F2 A6 00

Tainted data which is about to be used in instruction execution

Snitch perl script

Argos II

-Operating system: Win2000-Attacked service / program: WAR-FTPD

Information

Extractor #1

IP

TCP

FTPFTP

04 F2 A6 00

Position in

network

packet

Packet Field Decoding:FTP: bytes in USER field

Dest AddressSrc Address

Dest PortSrc Port

USER

Payload data

24Saturday, May 17, 2008 Pascal Gamper

Signature Generation

25Saturday, May 17, 2008 Pascal Gamper

Signature Generation Flow

1. Generate meta-signature

2. Determine signature quality

4. Save to database

5. Use Adapters to create specific signatures

6. Store, (correlate and/or distribute) adapted signatures

26Saturday, May 17, 2008 Pascal Gamper

Snort as Signature Format

SNORT for Proof-of-Concept SNORT is open source and well-known Simple signature format

Implications Only a part of extracted attack information can be

used, for example- We cannot include information about attacked program

27Saturday, May 17, 2008 Pascal Gamper

Generated signature (WAR-FTPD example)

alert tcp any any-> any 21 (msg: “(NoAH) RET via FTP protocol, USER command in war-ftpd.exe(win2k)”;

flow: established, from_client; content:"USER"; content:!"|0D 0A|"; offset: 5; depth: 465;)

28Saturday, May 17, 2008 Pascal Gamper

Signature Properties (WAR-FTPD example)

alert tcp any any-> any 21 (msg: “(NoAH) RET via FTP protocol, USER command in war-ftpd.exe(win2k)”;

flow: established, from_client; content:"USER"; content:!"|0D 0A|"; offset: 5; depth: 465;)

Connection state information

29Saturday, May 17, 2008 Pascal Gamper

Signature Properties (WAR-FTPD example)

alert tcp any any-> any 21 (msg: “(NoAH) RET via FTP protocol, USER command in war-ftpd.exe(win2k)”;

flow: established, from_client; content:"USER"; content:!"|0D 0A|"; offset: 5; depth: 465;)

State transition trigger

30Saturday, May 17, 2008 Pascal Gamper

Signature Properties (WAR-FTPD example)

alert tcp any any-> any 21 (msg: “(NoAH) RET via FTP protocol, USER command in war-ftpd.exe(win2k)”;

flow: established, from_client; content:"USER"; content:!"|0D 0A|"; offset: 5; depth: 465;)

Vulnerable field(s)

31Saturday, May 17, 2008 Pascal Gamper

Conclusion

Our ASG system generates signatures with almost zero false positives For remote code injection attacks If full amount of attack information is extracted

Signature describes the vulnerability of the application Protect server applications from buffer overflows in

arbitrary protocols and fields

> Our signatures can compete with other approaches including manually created reference signatures

32Saturday, May 17, 2008 Pascal Gamper

Questions?

33Saturday, May 17, 2008 Pascal Gamper

Evaluation

Prototype implementation IP, TCP, UDP, FTP protocol state machines

Examplary signature generation tests

Protocol context aware signatures: Average total generation time: 1,64 s Few false positives

LCS signatures (fallback strategy): Average total generation time: 3,46 s High rate of false positives depending on strings