Test whether the Web application has the cross-site scripting vulnerability.

Source: Internet
Author: User

So far, we have no objection to the threat of cross-site scripting attacks. If you are proficient in XSS and want to see what test methods are available for reference, skip to the test section in this article. If you do not know anything about this, please read it carefully in order! If a malicious user (attacker) can force an uninformed user (victim) to run the client script selected by the attacker, a cross-site scripting attack will occur. The word "cross-site scripting" should be inappropriate because it is not only related to scripts, but also not necessarily cross-site scripting. Therefore, it is a name that begins when such an attack is discovered and remains in use until now. From now on, we will use the common abbreviation "XSS ".

The XSS attack process involves the following three aspects:
• Attackers
• Victims
• Websites with vulnerabilities (attackers can use it to take actions against victims)

Among the three parties, only the victim will actually run the attacker's code. Websites are only a carrier of attacks and will not be affected. XSS attacks can be initiated in multiple ways. For example, an attacker can send a maliciously crafted malicious URL to the victim via email, IM, or other means. When the victim opens the URL in a Web browser, the website displays a page and executes the script on the victim's computer.

What is an XSS vulnerability?
As a Web developer or tester, you must know that the technical basis of Web applications is composed of HTTP and HTML. HTTP is the transmission mechanism of HTML. You can use code to design Web page layout and generate pages.

If the Web application accepts the input information submitted by the user through an HTTP request (such as GET or POST) and then displays the information in some places using the output HTML code, an XSS vulnerability may exist. The following is a simple example:

1. The Web request is as follows:
GET http://www.somesite.com/page.asp? Pageid = 10 & lang = en & title = Section % 20 Title

2. After a request is sent, the server returns the following HTML content:
<H1> Section Title

As you can see, user input passed to the title query string parameter may be saved in a string variable and inserted into the

3. Now, if the site does not filter user input on the server (because the client control can always be bypassed), malicious users can abuse the vulnerability by many means:

Attackers can inject code by getting rid of the

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.