Web Application Firewall Bypassing – an approach for pentesters

Slides:



Advertisements
Similar presentations
Approaches to meeting the PCI Vulnerability Management and Penetration Testing Requirements Clay Keller.
Advertisements

Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems © 2002, Predictive Systems.
HTML Forms. collect information for passing to server- side processes built up from standard widgets –text-input, radio buttons, check boxes, option lists,
 The Citrix Application Firewall prevents security breaches, data loss, and possible unauthorized modifications to Web sites that access sensitive business.
 Firewalls and Application Level Gateways (ALGs)  Usually configured to protect from at least two types of attack ▪ Control sites which local users.
It’s always better live. MSDN Events Security Best Practices Part 2 of 2 Reducing Vulnerabilities using Visual Studio 2008.
SQL Injection and Buffer overflow
Methods For The Prevention, Detection And Removal Of Software Security Vulnerabilities Jay-Evan J. Tevis Department of Computer Science and Software Engineering.
Department Of Computer Engineering
W3af LUCA ALEXANDRA ADELA – MISS 1. w3af  Web Application Attack and Audit Framework  Secures web applications by finding and exploiting web application.
Introduction to Application Penetration Testing
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Basic Security Networking for Home and Small Businesses – Chapter 8.
AIS, Passwords Should not be shared Should be changed by user Should be changed frequently and upon compromise (suspected unauthorized disclosure)
Brad Baker CS526 May 7 th, /7/ Project goals 2. Test Environment 3. The Problem 4. Some Solutions 5. ModSecurity Overview 6. ModSecurity.
Security.NET Chapter 1. How Do Attacks Occur? Stages of attack Examples of attacker actions 1. FootprintRuns a port scan on the firewall 2. PenetrationExploits.
Prevent Cross-Site Scripting (XSS) attack
Hamdi Yesilyurt, MA Student in MSDF & PhD-Public Affaris SQL Riji Jacob MS Student in Computer Science.
©2008 Gotham Digital Science Secure Parameter Filter (SPF) (AKA Protecting Vulnerable Applications with IIS7) Justin Clarke, Andrew Carey Nairn.
IST 210 Web Application Security. IST 210 Introduction Security is a process of authenticating users and controlling what a user can see or do.
Computer Security and Penetration Testing
Web Application Firewall (WAF) RSA ® Conference 2013.
CGI Security COEN 351. CGI Security Security holes are exploited by user input. We need to check user input against Buffer overflows etc. that cause a.
Online Translation Service Capstone Design Eunyoung Ku Jason Roberts Jennifer Pitts Gregory Woodburn Kim Tran.
Implementing a Port Knocking System in C Honors Thesis Defense by Matt Doyle.
Chapter 2. Core Defense Mechanisms. Fundamental security problem All user input is untrusted.
Web Application Security ECE ECE Internetwork Security What is a Web Application? An application generally comprised of a collection of scripts.
SIGITE 2008: Oct Integrating Web Application Security into the IT Curriculum James Walden Northern Kentucky University.
 Chapter 14 – Security Engineering 1 Chapter 12 Dependability and Security Specification 1.
1 Topic 2: Lesson 3 Intro to Firewalls Summary. 2 Basic questions What is a firewall? What is a firewall? What can a firewall do? What can a firewall.
Beyond negative security Signatures are not always enough Or Katz Trustwave ot.com/
APPLICATION PENETRATION TESTING Author: Herbert H. Thompson Presentation by: Nancy Cohen.
October 3, 2008IMI Security Symposium Application Security through a Hacker’s Eyes James Walden Northern Kentucky University
Traffic Management - OpenFlow Switch on the NetFPGA platform Chun-Jen Chung( ) Sriram Gopinath( )
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
Intrusion Detection Systems Paper written detailing importance of audit data in detecting misuse + user behavior 1984-SRI int’l develop method of.
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
Regan Little. Definition Methods of Screening Types of Firewall Network-Level Firewalls Circuit-Level Firewalls Application-Level Firewalls Stateful Multi-Level.
Carrie Estes Collin Donaldson.  Zero day attacks  “zero day”  Web application attacks  Signing up for a class  Hardening the web server  Enhancing.
Introduction SQL Injection is a very old security attack. It first came into existence in the early 1990's ex: ”Hackers” movie hero does SQL Injection.
HIPS. Host-Based Intrusion Prevention Systems  One of the major benefits to HIPS technology is the ability to identify and stop known and unknown attacks,
Chapter 40 Internet Security.
Database and Cloud Security
Application Communities
Final Project: Advanced security blade
Module: Software Engineering of Web Applications
CSCE 548 Student Presentation Ryan Labrador
Ilija Jovičić Sophos Consultant.
Module: Software Engineering of Web Applications
Critical Security Controls
FIREWALL configuration in linux
Chapter 7: Identifying Advanced Attacks
Penetration Test Debrief
SQL Injection.
Real-time protection for web sites and web apps against ATTACKS
Securing the Network Perimeter with ISA 2004
Threat Management Gateway
Security mechanisms and vulnerabilities in .NET
Penetration Test Debrief
Little work is accurate
Intercept X for Server Early Access Program Sophos Tester
11/17/2018 9:32 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
AKAMAI INTELLIGENT PLATFORM™
Intrusion Prevention Systems
Lecture 2 - SQL Injection
Spam Fighting at CERN 12 January 2019 Emmanuel Ormancey.
Finding High-Risk Web Vulnerabilities with a Small Number of Generic Payloads Detecting Server-Side Injection Vulnerabilities using Expression Probing.
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems
Exploring DOM-Based Cross Site Attacks
Presentation transcript:

Web Application Firewall Bypassing – an approach for pentesters Khalil bijjou Security Consultant EUROSEC – Security since 1998 11th November 2016

BypassING a WAF – WHY? Number of deployed Web Application Firewalls (WAFs) is increasing WAFs make a penetration test more difficult Attempting to bypass a WAF is an important aspect of a penetration test

MAIN GOAL Provide a practical approach for penetration testers which helps to ensure accurate results

Introduction to Web Application Firewalls

OVERVIEW Replaces old fashioned Firewalls and IDS/IPS Understands HTTP traffic better than traditional firewalls Protects a web application by adding a security layer Checks for malicious traffic and blocks it

FUNCTIONALITY Pre-processor: Decide whether a request will be processed further Normalization: Standardize user input Validate Input: Check user input against rules

Normalization functions Simplifies the writing of rules No Knowledge about different forms of input needed compressWhitespace converts whitespace chars to spaces hexDecode decodes a hex-encoded string lowercase converts characters to lowercase urlDecode decodes a URL-encoded string

Input validation Security Models define how to enforce rules Rules consist of regular expressions Three Security Models: Positive Security Model Negative Security Model Hybrid Security Model

Security models Positive Security Model (Whitelist) Negative Security Model (Blacklist) Deny all but known good Allow all but known bad Prevents Zero-day Exploits Shipped with WAF More secure than blacklist Fast adoption Comprehensive understanding of application is needed Little knowledge needed Creating rules is a time-consuming process Protect several applications Tends to false positives Resource-consuming

Bypassing Methods and Techniques

Overview Pre-processor Exploitation: Make WAF skip input validation Impedance Mismatch: WAF interprets input differently than back end Rule Set Bypassing: Use Payloads that are not detected by the WAF

Pre-processor Exploitation

Skipping parameter verification PHP removes whitespaces from parameter names or transforms them into underscores ASP removes % character that is not followed by two hexadecimal digits A WAF which does not reject unknown parameters may be bypassed http://www.website.com/products.php?%20productid=select 1,2,3 http://www.website.com/products.aspx?%productid=select 1,2,3

MALFORMED HTTP Method Misconfigured web servers may accept malformed HTTP methods A WAF that only inspects GET and POST requests may be bypassed

Overloading the waf A WAF may be configured to skip input validation if performance load is heavy Often applies to embedded WAFs Great deal of malicious requests can be sent with the chance that the WAF will overload and let some requests through

Impedance Mismatch

HTTP PARAMETER POLLUTION Sending a number of parameters with the same name Technologies interpret this request differently: http://www.website.com/products/?productid=1&productid=2 Back end Behavior Processed ASP.NET Concatenate with comma productid=1,2 JSP First Occurrence productid=1 PHP Last Occurrence productid=2

HTTP PARAMETER POLLUTION The following payload can be divided: WAF sees two individual parameters and may not detect the payload ASP.NET back end concatenates both values ?productid=select 1,2,3 from table ?productid=select 1&productid=2,3 from table

DOUBLE URL ENCODING WAF normalizes URL encoded characters into ASCII text The WAF may be configured to decode characters only once Double URL Encoding a payload may result in a bypass The following payload contains a double URL encoded character ’s’ -> %73 -> %25%37%33 1 union %25%37%33elect 1,2,3

Rule Set Bypassing

BYPASS RULE SET Two methods: Brute force by enumerating payloads Reverse-engineer the WAFs rule set

Approach for Penetration Testers

Overview Similar to the phases of a penetration test Divided into six phases, whereas Phase 0 may not always be possible

Phase 0 – DISABLE WAF Objective: find security flaws in the application more easily assessment of the security level of an application is more accurate Allows a more focused approach when the WAF is enabled May not be realizable in some penetration tests

Phase 1 - Reconnaissance Objective: Gather information to get a overview of the target Basis for the subsequent phases Gather information about: web server programming language WAF & Security Model Internal IP Addresses

Phase 2 – attacking the pre-processor Objective: make the WAF skip input validation Identify which parts of a HTTP request are inspected by the WAF to develop an exploit: Send individual requests that differ in the location of a payload Observe which requests are blocked Attempt to develop an exploit

Phase 3 – findING an impedance mismatch Objective: make the WAF interpret a request differently than the back end and therefore not detecting it Knowledge about back end technologies is needed

PHASE 4 – Bypassing the rule set Objective: find a payload that is not blocked by the WAFs rule set Brute force by sending different payloads Reverse-engineer the rule set in a trial and error approach: Send symbols and keywords that may be useful to craft a payload Observe which are blocked Attempt to develop an exploit based on the results of the previous steps

PHASE 5 – Other vulnerabilities Objective: find other vulnerabilities that can not be detected by the WAF Broken authentication mechanism Privilege escalation Etc.

PHASE 6 – after the pentest Objective: Inform customer about the vulnerabilities Advise customer to fix the root cause of a vulnerability For the time being, the vulnerability should be virtually patched by adding specific rules to the WAF Explain that the WAF can help to mitigate a vulnerability, but can not thoroughly fix it

WAFNinja

Overview CLI Tool written in Python Automates parts of the approach Already used in several penetration tests Supports HTTPS connections GET and POST parameter Usage of cookies Usage of an intercepting browser

Fuzzing Sends different symbols and keywords Analyzes the response Results are displayed in a clear and concise way Fuzzing strings can be extended with the insert-fuzz function shared within a team

Discussion & Questions E-Mail: kh.bijjou@gmail.com LinkedIn: Khalil Bijjou