Watch your door.-xss Attack (1)-Use reflective XSS vulnerability Cottage Red flag

Source: Internet
Author: User

The first thing to declare is that this article is purely an ignorant view of a little developer without foresight and knowledge, and is intended only for reference in Web system security.

1. Reflection Type XSS Vulnerability

If an application uses dynamic pages to display error messages to the user, it can create a common XSS vulnerability if the system does not filter and process the user-entered content.
Extracting the user-submitted input and inserting it into the HTML code of the server response is an obvious feature of the XSS vulnerability and is vulnerable to attack if the application does not implement any filtering or decontamination measures.

2. Prerequisites and Preparation

Now many browsers default some features to prevent XSS vulnerabilities or attacks, it is recommended to do an XSS test with IE browser, in order to let the test start normally. We need to turn off the XSS filter that comes with IE browser. In Tools-Internet Options-security-Custom level, locate enable XSS filter, and then select Disable.

3. A page that can be injected into an XSS vulnerability

xssreflect.jsp

<%@ page language="java" import="java.util.*" pageencoding= "UTF-8"%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" ><html><head><title>Watch your door,-ah, classmate.</title><meta name="Author" content ="Fan Fangming"></head>  <body>Your address:<%= (String)request. GETREMOTEADDR ()%> <br>Announcement message:<%= (String)request. GetParameter ("message")%>  <br>  </body></html>
4. Normal access and use of XSS simple attacks

Normal access
Http://127.0.0.1:8080/webStudy/XssReflect.jsp?message=hi,erveryone

This page does not filter and handle message injection, so you can live HTML script or other stuff.
Http://127.0.0.1:8080/webStudy/XssReflect.jsp?message=%3Cscript%3Ealert (1)%3c/script%3e
The above list of things has been encoded by the browser, which is actually:
Http://127.0.0.1:8080/webStudy/XssReflect.jsp?message=

And then came out with a dialog box.
Since the dialog box can come out, then it looks like other things can also.

5, the cottage red to the loopholes of the site to insert red flag

To the cottage Red Guest, first find a red flag, casually Baidu under, find a red flag picture:

Http://pic4.nipic.com/20091207/3886412_125107000722_2.jpg

We add the following message:

I‘m hongKe<img src="http://pic4.nipic.com/20091207/3886412_125107000722_2.jpg"  />

Make up the following URL

http://127.0.0.1:8080/webStudy/XssReflect.jsp?message=I%27m%20hongKe%3Cimg%20src=%22http://pic4.nipic.com/ 20091207/3886412_125107000722_2.jpg%22%20/%3e

effect
the body of the page is occupied by a large red flag .

Watch your door.-xss Attack (1)-Use reflective XSS vulnerability Cottage Red flag

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.