23
Tolera’ng Overload A/acks Against Packet Capturing Systems Antonis Papadogiannakis FORTHICS, Greece Michalis Polychronakis Columbia University, USA Evangelos P. Markatos FORTHICS, Greece USENIX ATC 2012

Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

1  

Tolera'ng  Overload  A/acks    Against  Packet  Capturing  Systems  

             

 Antonis  Papadogiannakis    FORTH-­‐ICS,  Greece    Michalis  Polychronakis    Columbia  University,  USA    Evangelos  P.  Markatos    FORTH-­‐ICS,  Greece  

 

USENIX ATC 2012

Page 2: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Network  Traffic  Monitoring  Applica'ons  

USENIX  ATC  2012  [email protected]   2  

•  Network-­‐level  intrusion  detecGon  •  Network  traffic  classificaGon  •  Next-­‐generaGon  firewalls  

•  Based  on  packet  capturing  systems  •  Need  to  analyze  all  packets  at  real-­‐Gme  on  mulG-­‐Gigabit  links  

Page 3: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

What  Happens  in  Case  of  Overload?  

•  Short-­‐term  traffic  or  processing  bursts  •  Handled  with  limited  buffering  in  main  memory  

USENIX  ATC  2012  [email protected]   3  

•  When  memory  buffer  becomes  full,  excess  packets  are  randomly  dropped  

•  Important  packets  may  be  lost  •  e.g.  missed  aUacks  

Page 4: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Even  Worse:  Overload  A/acks  

•  Algorithmic  complexity  aUacks    – Exploit  the  differences  between  average  case  and  worst  case  complexity  

– Low  bandwidth  aUacks  – Each  packet  results  to  orders  of  magnitude  slower  processing  

•  Traffic  overload  aUack  – Higher  rates  than  the  system  can  handle  

USENIX  ATC  2012  [email protected]   4  

Page 5: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Exis'ng  Solu'ons  

•  Provisioning  – Tune  the  system  for  worst  case  scenarios  

•  Thresholds  •  Algorithmic  soluGons  

– Reduce  the  difference  between  average  and  worst  case  performance  

•  SelecGve  discarding  – Discard  the  less  important  packets  under  overload  

USENIX  ATC  2012  [email protected]   5  

Page 6: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Our  Approach:  Selec,ve  Packet  Paging  

•  Two  layer  memory  management  – Excess  packets  are  buffered  to  secondary  storage  – All  packets  are  analyzed    

•  DetecGon  with  randomized  Gmeout  interval  – Detects  malicious  packets  that  slowdown  the  system  

– Send  these  packets  to  secondary  storage  

USENIX  ATC  2012  [email protected]   6  

Page 7: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

M4  

7  USENIX  ATC  2012  [email protected]  

Packet  Paging:  Two-­‐layer  Memory  Management  

Memory  Buffer  

Disk  Buffer  

D2   D3   D4   D5   D6   D7   D8  

Packet  Receive  Index  (bitmap)  

M:  packet  stored  in  memory  

D:    packet  stored  in  disk  

M1   M2   M3   M4  

D  M   M   M   M  

D1  

M  

Page 8: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

•  Modern  disks  – Three  orders  of  magnitude  more  storage  than  main  memory  

– Disk  throughput  increases,  mulGple  disks  organized  in  RAID0  

•  Packet  capturing  and  storing  thread  has  higher  priority  than  packet  processing  thread  

•  Disk  I/O  thread  prefetches  packets  from  disk  and  opGmizes  throughput  

USENIX  ATC  2012  [email protected]   8  

Packet  Paging:  Two-­‐layer  Memory  Management  

Page 9: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Selec,ve  Packet  Paging  

•  With  packet  paging,  both  benign  and  malicious  packets  are  buffered  to  disk  –  Increased  delay  for  benign  packets  

•  With  selec,ve  packet  paging  only  malicious  packets  are  buffered  to  disk  – Benign  packets  do  not  experience  any  delay  – Malicious  packets  experience  almost  the  same  delay  

USENIX  ATC  2012  [email protected]   9  

Page 10: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Malicious  Packet  Detec'on  

•  Malicious  packets:  packets  with  unusually  high  processing  Gmes  

•  The  problem:  detecGng  malicious  packets  that  slowdown  the  system  with  minimum  overhead  

USENIX  ATC  2012  [email protected]   10  

Page 11: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

1st  way:  Using  the  Timestamp  Counter  

USENIX  ATC  2012  [email protected]   11  

read_timestamp();

process_packet();

read_timestamp();

User  level,  not  interrupt  driven  Problem1:  the  packet  cannot  be  evicted  

Problem2:  measures  the  total  system  Gme,  not  applicaGon’s  CPU  Gme  

Page 12: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

12  

2nd  way:  SeWng  a  Timer  per-­‐packet  

USENIX  ATC  2012  [email protected]  

set_timer(interval);

process_packet();

Kernel  based,  interrupt  driven,  Gmer  expiraGon  based  on  applicaGon’s  CPU  Gme  

Problem  1:  runGme  overhead  for  secng  a  Gmer  per  packet  

Problem  2:  a  constant  or  predictable  interval  can  be  used  by  aUackers  to  evade  detecGon  

Page 13: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

13  

Randomized  Timeout  Interval  

USENIX  ATC  2012  [email protected]  

set_timer(random interval);

process_packets();

The  Gmeout  interval  is  chosen  randomly  from  [low,  high]  

At  Gmer  expiraGon:  check  if  the  same  packet  is  being  processed  

Page 14: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Detec'on  Probability  

USENIX  ATC  2012  [email protected]   14  

)(2)((det)2

lowhighdlowd

tddaP

−××

−×

+

×=

a

is  the  average  processing  Gme  of  benign  packets  is  the  average  processing  Gme  of  aUack  packets  is  the  percentage  of  aUack  packets  dt

Probability  of  detecGng  an  aUack  afer  N  Gmeouts:  NP(det))1(1 −− approaches  1  very  

fast  Average  detecGon  Gme:  1(det)/1 += PT Gmeouts  2/)( lowhighT −× μs  

Page 15: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

15  

Detec'on  Time  

low=50  μs,  high=1000  μs  

USENIX  ATC  2012  [email protected]  

A/ack  detected  within  10  ms  for  100%  a/ack  packets  and  200  μs  processing  delay  A/ack  detected  within  170  ms  

for  25%  a/ack  packets  and  100  μs  processing  delay  

Page 16: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Implementa'on  

•  Within  the  popular  libpcap  packet  capture  library  

•  ExisGng  applicaGons  can  use  selecGve  packet  paging  without  code  modificaGons  

USENIX  ATC  2012  [email protected]   16  

Page 17: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Experimental  Evalua'on  

•  Two  experiments  – Algorithmic  complexity  aUack  against  Snort’s  regular  expression  matching  using  excessive  backtracks  

– Traffic  overload  aUack  against  Snort  

USENIX  ATC  2012  [email protected]   17  

Page 18: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Algorithmic  Complexity  A/ack:  Dropped  Packets  

USENIX  ATC  2012  [email protected]   18  

For  104  cra^ed  packets  per  minute  pcap  loses  more  than  80%  of  the  packets  

Only  the  algorithmic  a/ack  packets  are  buffered  to  disk  by  SPP  

No  packet  dropped    with  SPP  for  up  to  106  cra^ed  packets  per  minute  

Page 19: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Algorithmic  Complexity  A/ack:  Detected  A/acks  

USENIX  ATC  2012  [email protected]   19  

Snort  on  top  of  the  original  pcap  misses  all  a/acks  for  105  cra^ed  packets/minute  

Snort  on  top  of  SPP  detects  all  a/acks  for  rates  up  to  106  packets/minute  

Page 20: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Traffic  Overload  A/ack:  Dropped  Packets  

USENIX  ATC  2012  [email protected]   20  

30-­‐seconds  long  traffic  bursts  

For  2  Gbit/s  traffic  burst  the  original  pcap  drops  53%  of  the  packets  

Pcap  with  SPP  drops  no  packets  for  traffic  bursts  up  to  2  Gbit/s  

Dropped  packets    with  original  pcap  are  buffered  to  disk  with  SPP  

Page 21: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Traffic  Overload  A/ack:  Detected  A/acks  

USENIX  ATC  2012  [email protected]   21  

30-­‐seconds  long  traffic  bursts  

For  2  Gbit/s  burst  rate  Snort  with  original  pcap  miss  32.5%  of  the  a/acks  

Snort  with  SPP  misses  no  a/ack  for  burst  rate  up  to    2  Gbit/sec  

Page 22: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

Summary  

•  Difficulty  to  predict  and  avoid  overloads  •  As  monitoring  applicaGons  become  more  complex,  they  may  be  more  vulnerable  to  algorithmic  a/acks  

•  SelecKve  Packet  Paging:  generic  defense  against  unknown  algorithmic  aUacks  and  unpredictable  overloads  –  Two-­‐layer  memory  management,  using  secondary  storage  –  DetecGon  based  on  randomized  Gmers  

•  Disk  throughput  increase  as  network  speeds  increase  –  Disks  can  be  organized  in  RAID0  

USENIX  ATC  2012  [email protected]   22  

Page 23: Tolera’ng*Overload*Aacks** Against*Packet ... - USENIX

23  

Tolera'ng  Overload  A/acks    Against  Packet  Capturing  Systems  

               

 Antonis  Papadogiannakis    [email protected]    Michalis  Polychronakis    [email protected]    Evangelos  P.  Markatos    [email protected]