Attack Transformation to Evade Intrusion Detection

Slides:



Advertisements
Similar presentations
Author : Xinming Chen,Kailin Ge,Zhen Chen and Jun Li Publisher : ANCS, 2011 Presenter : Tsung-Lin Hsieh Date : 2011/12/14 1.
Advertisements

Linear Obfuscation to Combat Symbolic Execution Zhi Wang 1, Jiang Ming 2, Chunfu Jia 1 and Debin Gao 3 1 Nankai University 2 Pennsylvania State University.
Using Cell Processors for Intrusion Detection through Regular Expression Matching with Speculation Author: C˘at˘alin Radu, C˘at˘alin Leordeanu, Valentin.
Protomatching Network Traffic for High Throughput Network Intrusion Detection Shai RubinSomesh JhaBarton P. Miller Microsoft Security Analysis Services.
Yan Chen Northwestern Lab for Internet and Security Technology (LIST) Dept. of Electrical Engineering and Computer Science Northwestern University
Deterministic Memory- Efficient String Matching Algorithms for Intrusion Detection Nathan Tuck, Timothy Sherwood, Brad Calder, George Varghese Department.
UltraPAC : automated protocol parser generator Daniel Burgener Jing Yuan.
Deep Packet Inspection with Regular Expression Matching Min Chen, Danny Guo {michen, CSE Dept, UC Riverside 03/14/2007.
Network-based and Attack-resilient Length Signature Generation for Zero-day Polymorphic Worms Zhichun Li 1, Lanjia Wang 2, Yan Chen 1 and Judy Fu 3 1 Lab.
Network-based and Attack-resilient Length Signature Generation for Zero-day Polymorphic Worms Zhichun Li 1, Lanjia Wang 2, Yan Chen 1 and Judy Fu 3 1 Lab.
Lucent Technologies – Proprietary Use pursuant to company instruction Learning Sequential Models for Detecting Anomalous Protocol Usage (work in progress)
By David Brumley, James Newsome, Dawn Song and Hao Wang and Somesh Jha.
Penetration Testing Security Analysis and Advanced Tools: Snort.
A Statistical Anomaly Detection Technique based on Three Different Network Features Yuji Waizumi Tohoku Univ.
Shield: Vulnerability-Driven End- Host Firewall for Preventing Known Vulnerability Attacks Sigcomm ’04.
Network-based Intrusion Detection and Prevention in Challenging and Emerging Environments: High-speed Data Center, Web 2.0, and Social Networks Yan Chen.
What is a Protocol A set of definitions and rules defining the method by which data is transferred between two or more entities or systems. The key elements.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Xitao Wen Xin Zhao Taiyo Sogawa. Protocol-level vulnerability and attack Defense: Intrusion Detection/Prevention Our goal o Defeat Cisco IPS by manipulating.
An Improved Algorithm to Accelerate Regular Expression Evaluation Author: Michela Becchi, Patrick Crowley Publisher: 3rd ACM/IEEE Symposium on Architecture.
Hamsa: Fast Signature Generation for Zero-day Polymorphic Worms with Provable Attack Resilience Zhichun Li, Manan Sanghi, Yan Chen, Ming-Yang Kao and Brian.
Chapter 6 Programming Languages (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
High-Speed Matching of Vulnerability Signatures Nabil Schear * David R. Albrecht † Nikita Borisov † University of Illinois at Urbana-Champaign * Department.
Firewall Fingerprinting Amir R. Khakpour 1, Joshua W. Hulst 1, Zhihui Ge 2, Alex X. Liu 1, Dan Pei 2, Jia Wang 2 1 Michigan State University 2 AT&T Labs.
1. Outline Introduction Related work on packet classification Grouper Performance Analysis Empirical Evaluation Conclusions 2/42.
Anomaly/Intrusion Detection and Prevention in Challenging Network Environments 1 Yan Chen Department of Electrical Engineering and Computer Science Northwestern.
Towards Vulnerability-Based Intrusion Detection with Event Processing Amer Farroukh, Mohammad Sadoghi, Hans-Arno Jacobsen University of Toronto July 13,
StriD 2 FA: Scalable Regular Expression Matching for Deep Packet Inspection Author: Xiaofei Wang, Junchen Jiang, Yi Tang, Bin Liu, and Xiaojun Wang Publisher:
Detecting Evasion Attack at High Speed without Reassembly.
1 NetShield: Massive Semantics-Based Vulnerability Signature Matching for High-Speed Networks Zhichun Li, Gao Xia, Hongyu Gao, Yi Tang, Yan Chen, Bin Liu,
Algorithms to Accelerate Multiple Regular Expressions Matching for Deep Packet Inspection Sailesh Kumar Sarang Dharmapurikar Fang Yu Patrick Crowley Jonathan.
Sets of Digital Data CSCI 2720 Fall 2005 Kraemer.
Anomaly/Intrusion Detection and Prevention in Challenging Network Environments 1 Yan Chen Department of Electrical Engineering and Computer Science Northwestern.
Towards High Performance Network Defense Zhichun Li EECS Department Northwestern University.
High-Speed Policy-Based Packet Forwarding Using Efficient Multi-dimensional Range Matching Lakshman and Stiliadis ACM SIGCOMM 98.
Polygraph: Automatically Generating Signatures for Polymorphic Worms Presented by: Devendra Salvi Paper by : James Newsome, Brad Karp, Dawn Song.
A Scalable Architecture For High-Throughput Regular-Expression Pattern Matching Yao Song 11/05/2015.
Yan Chen Department of Electrical Engineering and Computer Science
Automated Worm Fingerprinting Authors: Sumeet Singh, Cristian Estan, George Varghese and Stefan Savage Publish: OSDI'04. Presenter: YanYan Wang.
TFA: A Tunable Finite Automaton for Regular Expression Matching Author: Yang Xu, Junchen Jiang, Rihua Wei, Yang Song and H. Jonathan Chao Publisher: ACM/IEEE.
Yan Chen Lab for Internet and Security Technology EECS Department Northwestern University Intrusion Detection and Forensics for Self-defending Wireless.
Towards High Speed Network Defense Zhichun Li EECS Deparment Northwestern University.
Network-based and Attack-resilient Length Signature Generation for Zero-day Polymorphic Worms Zhichun Li 1, Lanjia Wang 2, Yan Chen 1 and Judy Fu 3 1 Lab.
Polygraph: Automatically Generating Signatures for Polymorphic Worms Authors: James Newsome (CMU), Brad Karp (Intel Research), Dawn Song (CMU) Presenter:
Packet Classification Using Multidimensional Cutting Sumeet Singh (UCSD) Florin Baboescu (UCSD) George Varghese (UCSD) Jia Wang (AT&T Labs-Research) Reviewed.
Monitoring, Diagnosing, and Securing the Internet 1 Yan Chen Department of Electrical Engineering and Computer Science Northwestern University Lab for.
Accelerating Multi-Pattern Matching on Compressed HTTP Traffic Dr. Anat Bremler-Barr (IDC) Joint work with Yaron Koral (IDC), Infocom[2009]
CS 404Ahmed Ezzat 1 CS 404 Introduction to Compiler Design Lecture 1 Ahmed Ezzat.
What is a Protocol A set of definitions and rules defining the method by which data is transferred between two or more entities or systems. The key elements.
Snort – IDS / IPS.
Chapter 9: Transport Layer
Introduction Chapter : Introduction.
Instructor Materials Chapter 9: Transport Layer
Automatic Network Protocol Analysis
POLYGRAPH: Automatically Generating Signatures for Polymorphic Worms
A Simple Syntax-Directed Translator
Introduction to Algorithms
Automated Parser Generation for High-Speed NIDS
Intrusion Detection/Prevention Systems
Automated Parser Generation for High-Speed NIDS
Zhichun Li, Gao Xia, Yi Tang, Yan Chen, and Bin Liu
Objective of This Course
Yan Chen Department of Electrical Engineering and Computer Science
Parsing Costas Busch - LSU.
Data Mining & Machine Learning Lab
Using decision trees to improve signature-based intrusion detection
Hash Functions for Network Applications (II)
Compiler Construction
Lec00-outline May 18, 2019 Compiler Design CS416 Compiler Design.
Introduction Chapter : Introduction.
Presentation transcript:

Attack Transformation to Evade Intrusion Detection Northwestern Lab for Internet and Security Technology (LIST)

Introduction Evade intrusion detection Our goal: Traditional approaches: fragmenting PDU in IP, TCP or RPC payload. Instead, we care about protocol-level flaws in signature. Our goal: Understand the robustness of Cisco IPS signatures as well as expressiveness of signature engine Improve signature generation practice and expressiveness

Result Highlight Analyze four vulnerabilities in detail Successfully evade IPS in all four vulnerabilities The result indicates issues in current signature generation practice Several potential solutions

Roadmap Technical details of evasion Potential solutions CVE-2008-0226 CVE-2006-1652 (server & client) Potential solutions Improve sig testing Vulnerability classification Vulnerability signature based IPS engine: NetShield

MySQL yaSSL Client Hello Buffer Overflow CVE-2008-0226 11/10/2018

Original Signature Signature 20420/0 on Cisco IPS 4270 \xcd\xa7\x21K\xe3U\xb3\x89\x3b\x00\xbeSH\xe9A\xac\x0e\x02\xd9\x93\xce\xda\xf2\xa2\xa3kMB\x60\xaa\xec\x02bb\x00Paaaaaaaa It doesn’t make sense to us… Not part of SSL handshake protocol Cannot match with exploit we could find

Manual Sig Generation One Available Exploit \xAA\x8D\x00\x00-(client_flags) \x00\x00\x00@-(max_packet_size) \b-(charset) \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-(filler) \x00\x00(size) \x01(client hello) \x03\x01 (version) \x00\x00 (cipher suites length) \x00\x00 (session ID length) \x0F\xFF (random size) 11/10/2018

Sig Generalization Wildcard the bytes not related to vul (\xAA\x8D)|(\x8D\xAA)\x00{5}\x40\x08[\x00-\xFF]{23} [\x00-\xFF][\x00-\xFF]\x01[\x00-\xFF][\x00-\xFF][\x00-\xFF] [\x00-\xFF][\x00-\xFF][\x00-\xFF]([\x10-\xFF][\x00-\xFF])|(\x0F\xFF)

Test We test it on Cisco IPS 4270 No known FN and FP found 11/10/2018

Samba call_trans2open Overflow CVE-2003-0201 11/10/2018

Vulnerability Info Parameter length determines the pname length Long array overflows the buffer, returns to shell code

Original Signature Sig ID: 5594/0 Not visible…

Exploit SMB command transaction2

Testing for Signature Ignore fields vital to triggering vulnerability eg. Protocol fields, etc. Focus on fields that are related to triggering vul, but have room for flexibility Mostly numerical parameters Patterns specific to particular exploit code eg. Flags field

Results Fields with more circles likely to be in signature Protocol fields in sig, but fixed As predicted by heuristics, Flags a likely candidate

Cisco IDS Evaded Changed Flags field to 0xff

UltraVNC Client Overflow CVE-2006-1652 11/10/2018

Original Signature Sig ID: 5751/0 Content: [Rr][Ff][Bb]\x20[0][0][3][.][0][0][0-9][\r\n] \x00\x00\x00\x00 ((\x00\x00[\x04-\xff][\x00-\xff]) |([\x01-\xff][\x00-\xff][\x00-\xff][\x00-\xff]) |([\x00][\x01-\xff][\x00-\xff][\x00-\xff])) [^\x00]+

Evaded Exploit Adapted from a public PoC RFB 003.006X ……

UltraVNC Server Overflow CVE-2006-1652 11/10/2018

Original Signature Sig ID: 5761/0 Original sig looks for \x20(space) in HTTP URI Correct sig should only specify length of URI

Evaded Exploit Eliminate all spaces in the URI field

Potential Solutions 11/10/2018

Source of Sig Inaccuracy Signature errors Solution: improve testing tools Insufficient expressiveness of sig language Solution: vulnerability classification, and NetShield (efficient symbolic constraint language matching)

Signature Testing Test common errors of manual generation Given vulnerability and a sample exploit, how can we generate test cases with good coverage? Test common errors of manual generation Alphabet search Exploit characteristics of regex Vary numeric value or length Field reorder

Vulnerability Classification Vul classification based on complexity Regex Byte-level symbolic constraint Protocol-level symbolic constraint Turing complete Using less expressive language to match more complex vul will inevitably introduce FN or FP

Vulnerability Classification We analyze 34 vulnerabilities manually Regex: 5 Byte-level: 5 Protocol-level: 13 Turing complete: 9 Inadequate info: 2

NetShield http://www.nshield.org/ 11/10/2018

Regular expression (regex) based approaches State Of The Art Regular expression (regex) based approaches Used by: Cisco IPS, Juniper IPS, open source Bro Example: .*Abc.*\x90+de[^\r\n]{30} Pros Can efficiently match multiple sigs simultaneously, through DFA Can describe the syntactic context Cons Limited expressive power Cannot describe the semantic context Inaccurate

Vulnerability Signature [Wang et al. 04] State Of The Art Vulnerability Signature [Wang et al. 04] Blaster Worm (WINRPC) Example: BIND: rpc_vers==5 && rpc_vers_minor==1 && packed_drep==\x10\x00\x00\x00 && context[0].abstract_syntax.uuid=UUID_RemoteActivation BIND-ACK: rpc_vers==5 && rpc_vers_minor==1 CALL: rpc_vers==5 && rpc_vers_minors==1 && packed_drep==\x10\x00\x00\x00 && opnum==0x00 && stub.RemoteActivationBody.actual_length>=40 && matchRE(stub.buffer, /^\x5c\x00\x5c\x00/) Good state Bad Vulnerability Signature Vulnerability: design flaws enable the bad inputs lead the program to a bad state Bad input Pros Directly describe semantic context Very expressive, can express the vulnerability condition exactly Accurate Cons Slow! Existing approaches all use sequential matching Require protocol parsing

Regex vs. Vulnerabilty Sigs Vulnerability Signature matching Parsing Matching Combining Regex cannot substitute parsing Theoretical prospective Practical prospective Regex Context Free Sensitive Protocol grammar HTTP chunk encoding DNS label pointers

Regex V.S. Vulnerabilty Sigs Regex + Parsing cannot solve the problem Regex assumes a single input Regex cannot help with combining phase Cannot simply extend regex approaches for vulnerability signatures

Motivation of NetShield

Research Challenges and Solutions Matching thousands of vulnerability signatures simultaneously Sequential matching match multiple sigs. simultaneously High speed protocol parsing Solutions (achieving 10s Gps throughput) An efficient algorithm which matches multiple sigs simultaneously A tailored parsing design for high-speed signature matching Code & ruleset release at www.nshield.org 35 35

NetShield System Architecture

Outline Motivation High Speed Matching for Large Rulesets High Speed Parsing Evaluation Research Contributions 37 37

Background Vulnerability signature basic Data representations Use protocol semantics to express vulnerabilities Defined on a sequence of PDUs & one predicate for each PDU Example: ver==1 && method==“put” && len(buf)>300 Data representations The basic data types used in predicates: numbers and strings number operators: ==, >, <, >=, <= String operators: ==, match_re(.,.), len(.). Blaster Worm (WINRPC) Example: BIND: rpc_vers==5 && rpc_vers_minor==1 && packed_drep==\x10\x00\x00\x00 && context[0].abstract_syntax.uuid=UUID_RemoteActivation BIND-ACK: rpc_vers==5 && rpc_vers_minor==1 CALL: rpc_vers==5 && rpc_vers_minors==1 && packed_drep==\x10\x00\x00\x00 && opnum==0x00 && stub.RemoteActivationBody.actual_length>=40 && matchRE(stub.buffer, /^\x5c\x00\x5c\x00/) 38 38

Matching Problem Formulation Suppose we have n signatures, defined on k matching dimensions (matchers) A matcher is a two-tuple (field, operation) or a four-tuple for the associative array elements Translate the n signatures to a n by k table This translation unlocks the potential of matching multiple signatures simultaneously Rule 4: URI.Filename=“fp40reg.dll” && len(Headers[“host”])>300 RuleID Method == Filename == Header == LEN 1 DELETE * 2 POST Header.php 3 awstats.pl 4 fp40reg.dll name==“host”; len(value)>300 5 name==“User-Agent”; len(value)>544 Multiple PDU matching problem (MPM) Associate array 39

Signature Matching Basic scheme for single PDU case Refinement Allow negative conditions Handle array cases Handle associative array cases Handle mutual exclusive cases Extend to Multiple PDU Matching (MPM) Allow checkpoints. 40 40

Difficulty of the Single PDU matching Bad News A well-known computational geometric problem can be reduced to this problem. And that problem has bad worst case bound O((log N)K-1) time or O(NK) space (worst case ruleset) Good News Measurement study on Snort and Cisco ruleset The real-world rulesets are good: the matchers are selective. With our design O(K)

Matching Algorithms Candidate Selection Algorithm Pre-computation: Decides the rule order and matcher order Runtime: Decomposition. Match each matcher separately and iteratively combine the results efficiently Matcher Implementation Integer range checking: Binary search tree String exact matching: Trie String regular expression: DFA, XFA, etc. String length checking: Binary search tree 42 42

Step 1: Pre-Computation Optimize the matcher order based on buffering constraint & field arrival order Rule reorder: 1 Require Matcher 1 Require Matcher 1 Require Matcher 2 For K matchers and N signatures, in worst case, a matcher has O(N) candidates, requiring O(K × N) operations in total. However, based on observations 1–3, we know that a matcher will usually only have C candidates, where C is a small constant. In that case, we can get O(k) speed. The algorithm needs O(K × N) space to hold the bitmap. For each connection in worst case we need O(N) space to hold the candidates. However, in practice we just need a constant space determined by C. Don’t care Matcher 1 Don’t care Matcher 1 & 2 n 43

Step 2: Iterative Matching PDU={Method=POST, Filename=fp40reg.dll, Header: name=“host”, len(value)=450} S1={2} Candidates after match Column 1 (method==) S2= S1 A2 +B2 ={2} {}+{4}={}+{4}={4} S3=S2 A3+B3 ={4} {4}+{}={4}+{}={4} Si Don’t care matcher i+1 require In Ai+1 RuleID Method == Filename == Header == LEN 1 DELETE * 2 POST Header.php 3 awstats.pl 4 fp40reg.dll name==“host”; len(value)>300 5 name==“User-Agent”; len(value)>544 R1 R2 R3 44 44

Complexity Analysis Merging complexity Three HTTP traces: avg(|Si|)<0.04 Two WINRPC traces: avg(|Si|)<1.5 Merging complexity Need k-1 merging iterations For each iteration Merge complexity O(n) the worst case, since Si can have O(n) candidates in the worst case rulesets For real-world rulesets, # of candidates is a small constant. Therefore, O(1) For real-world rulesets: O(k) which is the optimal we can get

Outline Motivation High Speed Matching for Large Rulesets. High Speed Parsing Evaluation Research Contribution 46 46

High Speed Parsing Design a parsing state machine Tree-based vs. Stream Parsers Keep the whole parse tree in memory Parsing and matching on the fly VS. Parse all the nodes in the tree Only signature related fields (leaf nodes) VS. Design a parsing state machine

High Speed Parsing Build an automated parser generator, UltraPAC

Observations PDU  parse tree Leaf nodes are numbers or strings array Observation 1: Only need to parse the fields related to signatures (mostly leaf nodes) Observation 2: Traditional recursive descent parsers which need one function call per node are too expensive 49 49

Efficient Parsing with State Machines Studied eight protocols: HTTP, FTP, SMTP, eMule, BitTorrent, WINRPC, SNMP and DNS as well as their vulnerability signatures Common relationship among leaf nodes Pre-construct parsing state machines based on parse trees and vulnerability signatures Protocol semantic are context sensitive 50 50

Outline Motivation High Speed Matching for Large Rulesets. High Speed Parsing Evaluation Research Contributions 51 51

Evaluation Methodology Fully implemented prototype 10,000 lines of C++ and 3,000 lines of Python Deployed at a DC in Tsinghua Univ. with up to 106Mbps 26GB+ Traces from Tsinghua Univ. (TH), Northwestern (NU) and DARPA Run on a P4 3.8Ghz single core PC w/ 4GB memory After TCP reassembly and preload the PDUs in memory For HTTP we have 794 vulnerability signatures which cover 973 Snort rules. For WINRPC we have 45 vulnerability signatures which cover 3,519 Snort rules The measured links experience a sustained traffic rate of roughly 20Mbps with bursts of up to 106Mbps. 52 52

Parsing Results Trace TH DNS TH WINRPC NU WINRPC TH HTTP NU HTTP DARPA HTTP Avg flow len (B) 77 879 596 6.6K 55K 2.1K Throughput (Gbps) Binpac Our parser 0.31 3.43 1.41 16.2 1.11 12.9 2.10 7.46 14.2 44.4 1.69 6.67 Speed up ratio 11.2 11.5 11.6 3.6 3.1 3.9 Max. memory per connection (bytes) 16 15 14 53 53

Parsing+Matching Results 11.0 8-core Trace TH WINRPC NU WINRPC TH HTTP NU HTTP DARPA HTTP Avg flow length (B) 879 596 6.6K 55K 2.1K Throughput (Gbps) Sequential CS Matching 10.68 14.37 9.23 10.61 0.34 2.63 2.37 17.63 0.28 1.85 Matching only time speedup ratio 4 1.8 11.3 11.7 8.8 Avg # of Candidates 1.16 1.48 0.033 0.038 0.0023 Avg. memory per connection (bytes) 32 28 54 54

Scalability Results Performance decrease gracefully

Accuracy Results Create two polymorphic WINRPC exploits which bypass the original Snort rules but detect accurately by our scheme. For 10-minute “clean” HTTP trace, Snort reported 42 alerts, NetShield reported 0 alerts. Manually verify the 42 alerts are false positives

Research Contribution Make vulnerability signature a practical solution for NIDS/NIPS Regular Expression Exists Vul. IDS NetShield Accuracy Poor Good Speed Memory ?? Multiple sig. matching  candidate selection algorithm Parsing  parsing state machine Tools at www.nshield.org 57 57

Q&A Q&A