380 likes | 573 Views
NoTamper : Automatic Blackbox Detection of Parameter Tampering Opportunities in Web Applications. Prithvi Bisht , Timothy Hinrichs , Nazari Skrupsky , Radoslaw Bobrowicz , V.N. Venkatakrishnan University of Illinois at Chicago, USA ACM CCS (Oct,2010) .
E N D
NoTamper: Automatic Blackbox Detection of Parameter Tampering Opportunities in Web Applications PrithviBisht , Timothy Hinrichs, NazariSkrupsky, RadoslawBobrowicz, V.N. Venkatakrishnan University of Illinois at Chicago, USA ACM CCS (Oct,2010) A Presentation at Advanced Defense Lab
Outline • Introduction • Architecture & Challenges • Implementation • Evaluation • Related Work • Conclusion Advanced Defense Lab
Introduction • A novel approach for automatically detecting potential server-side vulnerabilities of parameter-tampering in existing web applications. Advanced Defense Lab
Introduction Advanced Defense Lab
Introduction • Attack 1: Negative quantities. • Resulting in a “discount”. • Attack 2: Charging another user’s account. • A malicious user can purchase products and charge someone else’s account. • Attack 3: Pattern validation bypass. • XSS and SQL injection. Advanced Defense Lab
Introduction – Problem Description • ∑: the set of alphabet. • I = ∑* x ∑* x ∑* x … x ∑* • I -> { true , false } • Pserver: constraint-checking function on the server. • Pclient: constraint-checking function on the client. • Pserver(I) = true -> Pclient(I) = true • Pserver(I) = true ^ Pclient(I) = false (BUG) Advanced Defense Lab
Introduction – Problem Description • Fclient: a logical representation of Pclient. • Fserver: a logical representation of Pserver. • (hostile) h1,…,hn such that Fclient(hi) = false for each i. • (benign) b1,…,bm such that Fclient(bj) = true for each j. • (hostile responses from the server) H1,…,Hn • (benign responses from the server) B1,…,Bm • The more similar a hostile response is to the benign responses, the more likely the hostile input was successful. Advanced Defense Lab
Outline • Introduction • Architecture & Challenges • Implementation • Evaluation • Related Work • Conclusion Advanced Defense Lab
ARCHITECTURE & CHALLENGES Advanced Defense Lab
ARCHITECTURE & CHALLENGES Advanced Defense Lab
ARCHITECTURE & CHALLENGESHTML/JS Analyzer • To simulates an environment similar to a JavaScript interpreter in a browser, including the DOM (AJAX not supported). • Executes all the init. Code for the web form concretely. Advanced Defense Lab
ARCHITECTURE & CHALLENGESHTML/JS Analyzer • Identifying JS validation code • When a form is submitted. • Each time the user enters or changes data on the form. • Analyzing JS validation code • Employing a mixed concrete-symbolic execution approach. • Symbolic execution provides coverage of all control paths. • Concrete execution enables NoTamper to ignore irrelevant code. • Resolving DOM references • Constructing the pertinent portion of the DOM. • Simulating DOM functions that are used to modify the DOM structure. Advanced Defense Lab
ARCHITECTURE & CHALLENGESInput Generator • Avoiding spurious rejections • Checking that all “required” variables have values of the right type. (Manually overridden) • Generating orthogonal hostile inputs • Converts Fclient to disjunctive normal form (DNF). • Coping with incomplete information • Accepting hints (delta) from human that guide the search for hostile and benign inputs. • Addressing state changes • Providing a optional list of variables required to have unique values. Advanced Defense Lab
Outline • Introduction • Architecture & Challenges • Implementation • Evaluation • Related Work • Conclusion Advanced Defense Lab
Implementation Advanced Defense Lab
IMPLEMENTATIONClient Constraint Extraction • By collecting all the event handlers (and associated scripts) and generating a single function that invokes all those event handlers. • Simulates a small set of core methods • getElementById() • document.wite() • document.innerHTML() Advanced Defense Lab
IMPLEMENTATIONClient Constraint Extraction Advanced Defense Lab
IMPLEMENTATIONHostile Input Guidance • Initial values • Numbers • Hidden fields (Session identifier) • Types • The HTML widget associated with (<SELECT>) • Initial value • Occurrence in arithmetic constraints • Required variables • Analyzing the HTML (e.g., asterisks next to field labels) • Drop-down list • Unique variables Advanced Defense Lab
IMPLEMENTATIONInput Generation • Benign inputs • Converts Fclient to DNF • Finds one solution per disjunct(or). • Hostile inputs • !Fclient Advanced Defense Lab
IMPLEMENTATIONConstraint Solving • HAMPI[13] Advanced Defense Lab
IMPLEMENTATIONConstraint Solving Advanced Defense Lab
IMPLEMENTATIONHTML Response Comparison • Compares the server’s response against a response that is known to have been generated by benign (valid) inputs. • Edit distance • Ratcliff/Obsershelp algorithm. • Remove the noise in B1 and B2 and produce C1. • Remove the noise in B1 and Hi and produce C2. • Compare C1 and C2 and result in “difference rank”. Advanced Defense Lab
IMPLEMENTATION • HTML analysis • On top of the APIs provided by the HTML Parser. • JavaScript analysis • Using a modified Narcissus JavaScript engine-based symbolic evaluator. • Input Generator • HAMPI • Opportunity Detector • Java-based module relayed HTTTP requests to the test server. Advanced Defense Lab
Outline • Introduction • Architecture & Challenges • Implementation • Evaluation • Related Work • Conclusion Advanced Defense Lab
Evaluation • Selected 8 open source applications and 5 live websites. • http://opensourcescripts.com • Testing • Linux Apache web server (2.8 GHz Dual Intel Xeon, 6.0 GB RAM) • Ubuntu 9.10 (2.45 Ghz Quad Intel, 2.0 GB RAM) NoTamper Advanced Defense Lab
Evaluation Advanced Defense Lab
Evaluation Advanced Defense Lab
Evaluation • Unauthorized money transfers • www.selfreliance.com • Unlimited shopping rebates • www.codemicro.com • Fixed within 24 hours • Privilege escalation • OpenIT • By manipulating the userid parameter. Advanced Defense Lab
EvaluationFalse Positives • Pertaining to the maxlength constraints on form inputs that couldn’t be exploited to any serious vulnerability. • Rewritten by the server without any observable difference in HTML output. Advanced Defense Lab
Evaluation Advanced Defense Lab
Evaluation Advanced Defense Lab
EvaluationPerformance • Input Generator • Solved 315 formulas in a total of 219 seconds. • Giving an average time of 0.7 seconds per input. • HTML / JavaScript • Run in under a second • Opportunity Detector • Run in sub-second time for each application. Advanced Defense Lab
Outline • Introduction • Architecture & Challenges • Implementation • Evaluation • Related Work • Conclusion Advanced Defense Lab
Related Work • NoTamer’s goals are focusing on discovering vulnerabilities in existing ( legacy ) applications. Advanced Defense Lab
Outline • Introduction • Architecture & Challenges • Implementation • Evaluation • Related Work • Conclusion Advanced Defense Lab
Conclusion • NoTamper’s results highlight a significant gap between the server-side parameter validation that should occur and the server-side validation that does occur in today’s web applications. Advanced Defense Lab