detecting evasion attack at high speed without reassembly

58
1 Detecting Evasion Attack at High Speed without Reassembly Presented by C.W. Hon K.K. To 26/Mar/2007

Upload: kin

Post on 15-Jan-2016

50 views

Category:

Documents


0 download

DESCRIPTION

Detecting Evasion Attack at High Speed without Reassembly. Presented by C.W. Hon K.K. To 26/Mar/2007. External attack. Internet. DMZONE. Enterprise switch. DNS. WEB. MAIL. Internal servers. Clients. Internal attack. Internet. DMZONE. Enterprise switch. DNS. WEB. MAIL. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Detecting Evasion Attack at High Speed without Reassembly

1

Detecting Evasion Attackat

High Speed without Reassembly

Presented by

C.W. Hon

K.K. To

26/Mar/2007

Page 2: Detecting Evasion Attack at High Speed without Reassembly

2

External attack

DNS WEB MAIL

DMZONE

Enterprise switch

Internal serversClients

Page 3: Detecting Evasion Attack at High Speed without Reassembly

3

Internal attack

DNS WEB MAIL

DMZONE

Enterprise switch

Internal serversClients

Page 4: Detecting Evasion Attack at High Speed without Reassembly

4

IDS/IPS integration

DNS WEB MAIL

DMZONE

Enterprise switch

Internal serversClients

Page 5: Detecting Evasion Attack at High Speed without Reassembly

5

IDS/IPS

IDS – Reactive approach

IPS – Proactive approach

IPS differs from IDS in that it takes a proactive approach to attacks - e.g. blocking the packets concerned - rather than a reactive approach - e.g. triggering human intervention.

Page 6: Detecting Evasion Attack at High Speed without Reassembly

6

IDS/IPS

• IPS can be describe as a subset of IDS where a subset of rules are enabled with the corresponding action to drop any packet that matches this rule.

☼ Minimum false positive is required.

Page 7: Detecting Evasion Attack at High Speed without Reassembly

7

Signature based IDS/IPS

• An IDS/IPS consists of a database of rules.

• Each rule specifies a predicate on packet headers, optionally contains a content string, and has an associated action.

Page 8: Detecting Evasion Attack at High Speed without Reassembly

8

Reassembly

• Both IDS and IPS are required to reassembly TCP flows and IP fragments.

• Ensures that a content string in a rule that is fragment across packets can be detected.

Page 9: Detecting Evasion Attack at High Speed without Reassembly

9

Normalization

• IPS is required to normalize TCP flows.

• Normalization seeks to normalize the data sent in a flow to avoid inconsistencies that can be exploited by an attacker.

Page 10: Detecting Evasion Attack at High Speed without Reassembly

10

What is Normalization

IP v4 Header

                                                                

             

Page 11: Detecting Evasion Attack at High Speed without Reassembly

11

IP Normalizations # IP Field Normalization Performed

1 Version Non-IPv4 packets dropped.

2 Header Len Drop if hdr_len too small.

3 Header Len Drop if hdr_len too large.

4 Diffserv Clear field.

5 ECN Clear field.

6Total Len Drop if tot_len > link layer

len.

7Total Len Trim if tot_len < link layer

len.

8 IP Identifier Encrypt ID.  

9 Protocol Enforce specific protocols.  

-Protocol Pass packet to

TCP,UDP,ICMP handlers.

10Frag offset Reassemble fragmented

packets.

11 Frag offset Drop if offset + len > 64KB.

# IP Field Normalization Performed

13 DF Drop if DF set and offset > 0.

14 Zero flag Clear.

15 Src addr Drop if class D or E.

16 Src addr Drop if MSByte=127 or 0.

17 Src addr Drop if 255.255.255.255.

18 Dst addr Drop if class E.

19 Dst addr Drop if MSByte=127 or 0.

20 Dst addr Drop if 255.255.255.255.

21TTL Raise TTL to configured

value.

22 Checksum Verify, drop if incorrect.

23 IP options Remove IP options.  

24 IP options Zero padding bytes.  

Page 12: Detecting Evasion Attack at High Speed without Reassembly

12

Bottlenecks in high speed IPS

Search content string

• regular expression

Reassemble and normalize the packets

• 1 million concurrent connections

• Avoid early timeout of late fragments

Page 13: Detecting Evasion Attack at High Speed without Reassembly

13

IPS

• As speed gets higher, reassembly and normalization in the network requires an increasing amount of resources in term of memory and processing.

BandwidthMemory

Processing

Page 14: Detecting Evasion Attack at High Speed without Reassembly

14

Argument

Folk Theorem

• Reassembly and normalization are sufficient to detect all evasions.

Challenge

• Are packet reassembly and normalization necessary to deal with evasions by attackers ?

Page 15: Detecting Evasion Attack at High Speed without Reassembly

15

Evasion Attack

• Attackers exploit the ambiguities between the IPS and the end hosts of handling packets.

ATTACK SIGNATURE

ATTA CK SIGN ATURE

Page 16: Detecting Evasion Attack at High Speed without Reassembly

16

IP Fragments

Problem-Not all IP fragments contains TCP header

Good news -IP fragment is rare in practice

Solution-All IP fragments redirect to slow path.

Page 17: Detecting Evasion Attack at High Speed without Reassembly

17

Types of Evasion Attack

• Misordered Fragments

• Interspersed Chaff

• Overlapping Fragments

- Combine with IP fragmentation

Page 18: Detecting Evasion Attack at High Speed without Reassembly

18

Example – Misordered Fragments

• Characteristics– Out-of-Order segments– Segments contains portion of the signature

SEQ=13, Data=“ACK” SEQ=10, Data=“ATT”

Arrival sequence

Page 19: Detecting Evasion Attack at High Speed without Reassembly

19

Example – Interspersed Chaff

• Characteristics– “Noise” or “Chaff” segments– Some segments with small TTL

SEQ=13, TTL=10, Data=“ACK”SEQ=10, TTL=10, Data=“ATT” SEQ=13, TTL=1, Data=“JKL”

Arrival sequence

Page 20: Detecting Evasion Attack at High Speed without Reassembly

20

Example – Overlapping Fragments

• Characteristics– Similar to the case of Interspersed Chaff– Signature embedded in arbitrary large

packets.

SEQ=13, Data=“ACK”SEQ=10, Data=“ATTJKL”

Arrival sequence

Page 21: Detecting Evasion Attack at High Speed without Reassembly

21

Basic Idea

- In case of high speed link, e.g. 20G bps

• Not all traffics are attack traffics, however, the classic IPS scans all traffic passing through it.

• Filter out the attack traffics by figuring out its characteristics and let good traffic passing through – path diversion

Page 22: Detecting Evasion Attack at High Speed without Reassembly

22

Classic IPS

Page 23: Detecting Evasion Attack at High Speed without Reassembly

23

Path Diversion

Page 24: Detecting Evasion Attack at High Speed without Reassembly

24

Proposed Solution

Assumptions• A small modification to TCP receivers to check

for inconsistent transmission – Weak Atomicity.• A change in the definition of signature detection

to allow the start and end of a signature to be missed – Split-Detect.

• A restriction to exact signature.

Page 25: Detecting Evasion Attack at High Speed without Reassembly

25

Weak Atomicity

Definition:

None of the bytes in a TCP segment that are delivered will be inconsistent with bytes of another TCP segment that are delivered.

Page 26: Detecting Evasion Attack at High Speed without Reassembly

26

Weak Atomicity

Implementation• Maintain a buffer – Overlap Detect Buffer.• Store the last MSS size bytes sent.• Compare the bytes of the new in-order packets

with the bytes in the buffer, deliver it if there is no inconsistency, reset the connection if inconsistency found.

• Take more space (1 MSS) and more processing (comparison).

Page 27: Detecting Evasion Attack at High Speed without Reassembly

27

Weak Atomicity

Advantages• Preventing bad behavior.• Do not need to implement a complete IPS at the

end nodes.• Fairly simple to implement.• Allowing current IPS to scale.

Page 28: Detecting Evasion Attack at High Speed without Reassembly

28

Weak Atomicity

Disadvantages• Introduced a new DOS attack.

– by injecting inconsistent data and cause the connection to be reset.

Page 29: Detecting Evasion Attack at High Speed without Reassembly

29

Weak Atomicity

What still remains?

The attackers can still:• Break up an attack signature.• Send out-of-order fragments.• Send small TTL packets, which will never reach

the end nodes.

Page 30: Detecting Evasion Attack at High Speed without Reassembly

30

Split-Detect

Basic Idea• Split the signature into K equal pieces.• Detect any pieces in the incoming packets at

fast path.• Divert a flow to the slow path if

– fast path detects any pieces, or– fast path detects small packets or out-of-order

behavior.

Page 31: Detecting Evasion Attack at High Speed without Reassembly

31

Small Packets

• Small packets defines the maximum payload size of a packet that contains portion of the signature but does not contains any signature pieces.

Page 32: Detecting Evasion Attack at High Speed without Reassembly

32

Small Packets

• A signature

Page 33: Detecting Evasion Attack at High Speed without Reassembly

33

Small Packets

• Signature pieces

• Attacker’s split

Page 34: Detecting Evasion Attack at High Speed without Reassembly

34

Small Packets

• Signature pieces

• Attacker’s split

Page 35: Detecting Evasion Attack at High Speed without Reassembly

35

Small Packets

• Signature pieces

• Attacker’s split

• payloadSize < 2PieceSize - 1

Page 36: Detecting Evasion Attack at High Speed without Reassembly

36

Fast Path

Implementation• Fast Path as a State Machine• State variables

– NES (Next Expected Sequence Number, 32 bits)– OOO (Out Of Order since last small packet, Boolean)– length (Length in bytes since last small packet, 7 bits)– count (Count of anomalies, 4 bits)– LUT (Last Update Time, 3 bits)

Starts keep states when the first small packet sent.

Page 37: Detecting Evasion Attack at High Speed without Reassembly

37

Fast Path

Implementation• State update mechanism (NES, OOO, length, count, LUT)

Update of count:– Initialized to 1 when the flow is first placed in the flow

table.– On receiving a small packet, increment if

• the packet’s sequence number not equal to NES, or

• OOO is true, or

• length ≤ SignatureLength

Counting anomalies.

Page 38: Detecting Evasion Attack at High Speed without Reassembly

38

Fast Path

Implementation• State update mechanism (NES, OOO, length, count, LUT)

Update of length:– If the current packet is large, incremented by the

payload length.– If the current packet is small, reset to 0.

Measures the length for this flow since last received small packet.

Page 39: Detecting Evasion Attack at High Speed without Reassembly

39

Fast Path

Implementation• State update mechanism (NES, OOO, length, count, LUT)

Update of OOO:– If the current packet is large and sequence number is

not equal to NES, set to true.– If the current packet is small, reset to false.

A flag that detects out-of-order reception between small packets.

Page 40: Detecting Evasion Attack at High Speed without Reassembly

40

Fast Path

Implementation• State update mechanism (NES, OOO, length, count, LUT)

Update of NES:– Set to s + l

where s = current packet sequence number

l = current packet payload length

Reflects the sequence number of the next expected in-order TCP segment.

Page 41: Detecting Evasion Attack at High Speed without Reassembly

41

Fast Path

Implementation• State update mechanism (NES, OOO, length, count, LUT)

Update of LUT:– All packets causes it to be updated to the current

time.

Page 42: Detecting Evasion Attack at High Speed without Reassembly

42

Fast Path

Implementation• Slow Path diversion

– After state update, the entire flow is diverted to the slow path if

• the packet contains a piece of signature.• the anomaly count count is equal to K-1.

– If the flow is not diverted, the packet is• forwarded normally, and• forwarded to the slow path iff the packet is small.

Page 43: Detecting Evasion Attack at High Speed without Reassembly

43

Slow Path

Implementation• Additional information indicating whether it is a copy of a

forwarded packet, or diverted packet.• If a flow is a diverted flow, it is responsible for deciding

whether to forward the packet on to the receiver.• For every flow, it maintains a single version of the

reassembled TCP stream. Drop the flow if there is inconsistency.

• If a flow is a diverted flow, it looks for the concatenation of pieces 2 to K-1 in the reassembled stream.

Page 44: Detecting Evasion Attack at High Speed without Reassembly

44

Theorems

Theorem 1: Fast Path Diversion

A TCP connection containing string S in some reassembled stream will be diverted to the slow path before or while processing the critical packet in the fast path.

Further, if prior to diversion, the fast path processed a collaborator of the critical packet, then a copy of the collaborator was sent to the slow path.

Page 45: Detecting Evasion Attack at High Speed without Reassembly

45

Theorems

Theorem 2: Slow Path Blocking

A TCP connection containing string S in some reassembled stream will have its critical packet dropped in the slow path (Safety).

Conversely, a TCP connection that does not contain Almost(S) in some reassembly of the connection and has no inconsistent data will not have any packets dropped at the IPS (Liveness).

Page 46: Detecting Evasion Attack at High Speed without Reassembly

46

Results

Page 47: Detecting Evasion Attack at High Speed without Reassembly

47

Results

Page 48: Detecting Evasion Attack at High Speed without Reassembly

48

Results

Page 49: Detecting Evasion Attack at High Speed without Reassembly

49

Results

Page 50: Detecting Evasion Attack at High Speed without Reassembly

50

Results

Page 51: Detecting Evasion Attack at High Speed without Reassembly

51

Results

Page 52: Detecting Evasion Attack at High Speed without Reassembly

52

Results

Page 53: Detecting Evasion Attack at High Speed without Reassembly

53

Results

Page 54: Detecting Evasion Attack at High Speed without Reassembly

54

Results

Page 55: Detecting Evasion Attack at High Speed without Reassembly

55

Results

Page 56: Detecting Evasion Attack at High Speed without Reassembly

56

Advantages

• Speedup

10 times

• Memory Compression

25 folds ?

Page 57: Detecting Evasion Attack at High Speed without Reassembly

57

Disadvantages

• Need to change the TCP implementation at the end hosts.

• Compare only Almost(S) but not S.• Restriction on the exact signature.

Page 58: Detecting Evasion Attack at High Speed without Reassembly

58

~ END ~