A WAF, or Web Application Firewall, is a security solution designed to protect web applications from a variety of attacks. It sits between the client and the web server and monitors, filters, and blocks data packets as they travel to and from the web application.
Specifically, it can help mitigate attacks such as SQL injection, cross-site scripting (XSS), cross-site request forgery (CSRF), and other types of attacks aimed at web applications. WAFs can be configured to allow, block, or monitor web traffic based on various rules and security policies.
They can operate in two modes: a detect mode, where it only observes and logs potential malicious activity, and a block mode, where it actively blocks potentially malicious traffic. Some advanced WAFs even use machine learning and AI to detect and block sophisticated attacks.
Bypassing a Web Application Firewall (WAF) can be challenging, as they are designed to block certain types of malicious HTTP requests. However, there are tools and techniques that can help you in this process:
- Bypass Tools: Some tools are specifically designed to help you bypass WAFs. These include SQLMap, XSStrike, and WFuzz, among others. They provide methods to evade and exploit common WAF rules.
- WAF Identification: There are tools to help you identify the type of WAF in use, such as WAFW00F. This can give you insights into the WAF’s rule set and help you craft your bypass techniques accordingly.
- Find Collaborators via Web Sockets: If the WAF is not configured to block web socket messaging, you can use this to find collaborators without the need for encoding.
- Use Multiple Cookies: If the WAF rules are based on cookie values, you can try sending the request with multiple cookies.
- Use Custom Headers: Some WAFs may not inspect all custom headers. By including your malicious payload in a custom header, you can bypass the WAF.
Automation
- Running an Nmap Scan
2. WafW00f
3. WhatWaf
More Reading
- https://hacken.io/discover/how-to-bypass-waf-hackenproof-cheat-sheet/
- https://jlajara.gitlab.io/Bypass_WAF_Unicode
- https://blog.yeswehack.com/yeswerhackers/web-application-firewall-bypass/
- https://www.sisainfosec.com/blogs/identifying-web-application-firewall-in-a-network/
- https://owasp.org/www-pdf-archive/OWASP_Stammtisch_Frankfurt_WAF_Profiling_and_Evasion.pdf