WAF Bypass

Brief

A WAF or web application firewall helps protect web applications by filtering and monitoring HTTP traffic between a web application and the Internet.

It typically protects web applications from attacks such as cross-site forgery, cross-site-scripting (XSS), file inclusion, and SQL injection, among others.

A WAF is a protocol layer 7 defense (in the OSI model), and is not designed to defend against all types of attacks. This method of attack mitigation is usually part of a suite of tools which together create a holistic defense against a range of attack vectors.

Popular WAF vendors

Identify the WAF

WAFs use standard ports : 80, 443, 8000, 8008, 8080, and 8088.

Bypass techniques

Case Toggling

Combine upper and lower case characters for creating great payloads.

Examples

URL Encoding

  • Encode normal payloads with % encoding/URL encoding.

  • You can use Burp. It has an encoder/decoder tool.

Examples

Unicode

  • ASCII characters in Unicode encoding give us great variants for bypassing WAF.

  • Encode entire or part of the payload for obtaining results.

Examples

HTML Representation

  • WebApps encode special characters into HTML. Encoding and render them accordingly.

  • Basic bypass cases with HTML encoding numeric and generic.

Examples

Mixed Encoding

  • Such rules often tend to filter out a specific type of encoding.

  • Such filters can be bypassed by mixed encoding payloads.

  • Newlines and tabs and further add to obfuscation.

Examples

Using comments

  • Comments obfuscate standard payload vectors.

  • Different payloads have different ways of obfuscation.

Examples

Double Encoding

  • Web Application Firewall filters tend to encode characters to protect web app.

  • Poorly developed filters (without recursion filters) can be bypassed with double encoding.

Wildcard Obfuscation

  • Global patterns are used by various command-line utilities to work with multiple files.

  • We can change them to run system commands.

Examples

Junk Characters

  • Simple payloads get filtered out easily by WAF.

  • Adding some junk chars helps avoid detection (only specific cases ).

  • This technique often helps in confusing regex-based firewalls.

Examples

More

More | WAF Bypass Techniques
PortSwigger | WAF Bypass with BApp
YesWeHack | WAF Bypass

Last updated

Was this helpful?