Title: Network-based Intrusion Detection and Prevention in Challenging and Emerging Environments: High-speed Data Center, Web 2.0, and Social Networks
1Network-based Intrusion Detection and Prevention
in Challenging and Emerging Environments
High-speed Data Center, Web 2.0, and Social
Networks
Yan Chen Lab for Internet and Security Technology
(LIST) Department of Electrical Engineering and
Computer Science Northwestern University
2Chicago
3 4(No Transcript)
5Statistics
- Chicago 3rd largest city in US
- NU ranked 12 by US News World Report
- Established in 1851
- 8000 undergrads
- McCormick School of Engineering ranked 20
- 180 faculty members
- 1400 undergrads and similar of grad students
6Statistics of McCormick
- National academy memberships
- National Academy of Engineering (NAE) 12 active,
7 emeriti - National Academy of Science (NAS) 3 active
- Institute of Medicine (IoM) 1 emeritus
- American Academy of Arts and Sciences (AAAS) 5
active, 3 emeriti - National Medal of Technology 1 active
7NetShield Massive Semantics-Based Vulnerability
Signature Matching for High-Speed Networks
Zhichun Li, Gao Xia, Hongyu Gao, Yi Tang, Yan
Chen, Bin Liu, Junchen Jiang, and Yuezhou Lv NEC
Laboratories America, Inc. Northwestern
University Tsinghua University
supplies 3,026
travel 5,200
capital equipment 0
Facilities 0
publication 1,000
7
8- To keep network safe is a grand challenge
- Worms and Botnets are still popular
- e.g. Conficker worm outbreak in 2008 and
infected 915 million hosts.
9NIDS/NIPS Overview
- NIDS/NIPS (Network Intrusion
Detection/Prevention System)
NIDS/NIPS
Packets
Security alerts
9
10State Of The Art
Regular expression (regex) based approaches
Used by Cisco IPS, Juniper IPS, open source Bro
Example .Abc.\x90de\r\n30
- Pros
- Can efficiently match multiple sigs
simultaneously, through DFA - Can describe the syntactic context
- Cons
- Limited expressive power
- Cannot describe the semantic context
- Inaccurate
11State Of The Art
Vulnerability Signature Wang et al. 04
Blaster Worm (WINRPC) Example BIND rpc_vers5
rpc_vers_minor1 packed_drep\x10\x00\x00\
x00 context0.abstract_syntax.uuidUUID_Remote
Activation BIND-ACK rpc_vers5
rpc_vers_minor1 CALL rpc_vers5
rpc_vers_minors1 packed_drep\x10\x00\x00\x0
0 opnum0x00 stub.RemoteActivationBody.actu
al_lengthgt40 matchRE(stub.buffer,
/\x5c\x00\x5c\x00/)
- 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
12Regex vs. Vulnerabilty Sigs
Vulnerability Signature matching
Parsing
Matching
Combining
Regex cannot substitute parsing
Theoretical prospective
Practical prospective
Protocol grammar
- HTTP chunk encoding
- DNS label pointers
13Regex 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
14Motivation of NetShield
15Research Challenges and Solutions
- Challenges
- 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
16NetShield System Architecture
17Outline
- Motivation
- High Speed Matching for Large Rulesets
- High Speed Parsing
- Evaluation
- Research Contributions
18Background
- Vulnerability signature basic
- Use protocol semantics to express vulnerabilities
- Defined on a sequence of PDUs one predicate for
each PDU - Example ver1 methodput len(buf)gt300
- Data representations
- The basic data types used in predicates numbers
and strings - number operators , gt, lt, gt, lt
- String operators , match_re(.,.), len(.).
Blaster Worm (WINRPC) Example BIND rpc_vers5
rpc_vers_minor1 packed_drep\x10\x00\x00\
x00 context0.abstract_syntax.uuidUUID_Remote
Activation BIND-ACK rpc_vers5
rpc_vers_minor1 CALL rpc_vers5
rpc_vers_minors1 packed_drep\x10\x00\x00\x0
0 opnum0x00 stub.RemoteActivationBody.actu
al_lengthgt40 matchRE(stub.buffer,
/\x5c\x00\x5c\x00/)
18
19Matching 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.Filenamefp40reg.dll
len(Headershost)gt300
RuleID Method Filename Header LEN
1 DELETE
2 POST Header.php
3 awstats.pl
4 fp40reg.dll namehost len(value)gt300
5 nameUser-Agent len(value)gt544
20Signature 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.
21Difficulty 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)
22Matching 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
23Step 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
Dont care Matcher 1
Dont care Matcher 1 2
n
24Step 2 Iterative Matching
PDUMethodPOST, Filenamefp40reg.dll, Header
namehost, len(value)450
S12 Candidates after match Column 1 (method)
S2
B2
2
444
RuleID Method Filename Header LEN
1 DELETE
2 POST Header.php
3 awstats.pl
4 fp40reg.dll namehost len(value)gt300
5 nameUser-Agent len(value)gt544
R1
R2
R3
24
25Complexity Analysis
Three HTTP traces avg(Si)lt0.04 Two WINRPC
traces avg(Si)lt1.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
26Outline
- Motivation
- High Speed Matching for Large Rulesets.
- High Speed Parsing
- Evaluation
- Research Contribution
27High Speed Parsing
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
28High Speed Parsing
- Build an automated parser generator, UltraPAC
29Observations
PDU ? parse tree Leaf nodes are numbers or strings
PDU
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
29
30Efficient 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
30
31Outline
- Motivation
- High Speed Matching for Large Rulesets.
- High Speed Parsing
- Evaluation
- Research Contributions
32Evaluation 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
33Parsing 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 15 14 14 14
34ParsingMatching 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 32 28 28 28
35Scalability Results
Performance decrease gracefully
36Accuracy 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
37Research Contribution
Make vulnerability signature a practical
solution for NIDS/NIPS
Regular Expression Exists Vul. IDS NetShield
Accuracy Poor Good Good
Speed Good Poor Good
Memory Good ?? Good
- Multiple sig. matching ? candidate selection
algorithm - Parsing ? parsing state machine
- Tools at www.nshield.org
38QA
QA
394. Vulnerability Signature Matching for Large
Ruleset
- Three HTTP traces
- avg(Si)lt0.04
- Two WINRPC traces
- avg(Si)lt1.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 case
40Example for WINRPC
- Rectangles are states
- Parsing variables R0 .. R4
- 0.61 instruction/byte for BIND PDU
40
41Parser generator
- We reuse the front-end of BinPAC (a Yacc like
tool for protocol parsing) - Redesign the backend to generate the parsing
state machine based parser