Presentation on theme: "Backtracking Algorithmic Complexity Attacks Against a NIDS Randy Smith, Cristian Estan, Somesh Jha University of Wisconsin–Madison."— Presentation transcript:
Backtracking Algorithmic Complexity Attacks Against a NIDS Randy Smith, Cristian Estan, Somesh Jha University of Wisconsin–Madison
Algorithmic Complexity Attacks Vulnerable algorithm: algorithm whose worst case differs from typical case. The larger the difference, the more vulnerable the algorithm. Examples: AlgorithmAverageWorst QuicksortO(n log n)O(n 2 ) Hash lookupconstantO(n)
Algorithmic Complexity Attacks Algorithmic Complexity Attack – an attacker induces worst-case behavior in a vulnerable algorithm. Common observable effect is denial of service. Crosby and Wallach: induced worst-case behavior in hash function implementations. “Algorithms are now part of the attack surface” (Crosby and Wallach, 2003)
Are NIDS vulnerable? NIDS and IPS are ubiquitous, but… Do they contain vulnerable algorithms? Can they be exploited? YES! Only need 1 packet every 3 seconds.
Evading a NIDS Attacker’s Goal: Evade NIDS Two attack vectors in an evasion attempt: 1 st —alg. complexity attack targeting the NIDS 2 nd —true attack targeting the network Effect of an algorithmic complexity attack: (NIDS) Packets enter network unexamined (fail-closed IPS) Packets are dropped
Main results In Snort, vulnerability in rule-matching worst-case vs. typical case: 6 orders of magnitude. “Backtracking Attack” Easily exploitable through packet payloads Improved rule-matching algorithm limits running time differences to within 1 order of magnitude.
Are real rules vulnerable? Rule number Processing (s/GB) Slowdown Same protoAll traffic 3682 (SMTP)30,933,874232,936X1,501,644X 2611 (Oracle)6,220,76856,296X301,979X 1382 (IRC)1,956,858134,031X94,993X 2403 (NetBIOS)357,777490X17,368X 1755 (IMAP)89,181444X4,329X
Safer backtracking Memoization: maintain a table of subproblem “answers”; never evaluate a predicate twice at the same starting payload offset alert tcp $EXT_NET any -> $HOME_NET 99 (msg:”AudioPlayer jukebox exploit”; content:”fmt=”; //P1 pcre:”/^(mp3|ogg)/”,relative; //P2 content:”player=”; //P3 pcre:”/.exe|.com/”,relative; //P4 content:”overflow”,relative; //P5 sid:5678) Identify constrained predicate sequences Monotone memoization: don’t re-evaluate monotone predicates that have been evaluated at lower offsets
Live experiment topology Background TrafficAC AttackTrue Attack
Live experiment Background 10Mbps AC Attack Targets Snort SMTP rule 3682 Directed at sendmail server True Attack: NIMDA 300 exploit attempts, sent 1 byte per second. New exploit started every second.
Live experiment results Attack Description Exploits Detected Required Rate (kbps) Control (No attack)300/ packets every 60 s.220/ packet every 5 s.4/ packet every 3 s.0/ packets initially0/ packet every 3 s.300/ packets initially300/300--
Conclusions NIDS operation is complex. Many opportunities for vulnerable algorithms. In Snort, rule-matching is vulnerable and can be exploited by an attacker. Memoization, along with other semantics- preserving operations, significantly reduces vulnerability. Other vulnerable algoritms exist.
Backtracking Algorithmic Complexity Attacks Against a NIDS Thank you.