" information.Then Tom constructs a malicious URL (below), sent to Monica in some way (mail, QQ)Http://victim.com/search.asp?term=
Mark the important cookie as HTTP only so that the Document.cookie statement in JavaScript cannot get the cookie.
Only allow users to enter the data we expect. For example: In a TextBox of age, only users are allowed to enter numbers. and the characters outside the numbers are filtered out.
HTML Encode Processing of data
Web Security (1): cross-site scripting (XSS) and security-related xss
IntroductionCross-Site Scripting (XSS) attacks are not abbreviated to Cascading Style Sheet (CSS). Therefore, XSS attacks are abbreviated to Cross-Site Scripting (XSS) attacks. A malicious attacker inserts
professional XSS detection tools.Professional XSS scanning tools include well-known xsser, xssf, etc., as well as Web services (www.domxssscanner.com) that specialize in scanning Dom-type xss.It is generally necessary to use manual and software, because some XSS software can not detect, as some messages need to enter the verification code, etc., tools can not do
XSS, because the script is executed automatically whenever a user opens a Web page for content to view. The above Example 2 is a persistent cross-site scripting attack.
2.3 Dom-based cross-site scripting attacks, Dom-based XSS is sometimes referred to as "TYPE-0XSS". When it occurs, the XSS variable executes the result of modifying the user's browser page by the
91 XSS exists in the Community voting area, which can cause XSS worm Propagation 1: Create an arbitrary vote, add options, and add "XSS code" 2: Access the voting page to trigger the implementation of XSS Worm: the voting function of the custom js file target exists in xss.
Xss defense-php uses httponly to defend against xss attacks. The concept of xss is needless to say, and its harm is enormous. This means that once your website has an xss vulnerability, you can execute arbitrary js code, the most terrible thing is that attackers can exploit JavaScript to obtain the
XSS
Concept
XSS(crosssite Scripting) Multi-site Scripting attack refers to an attacker who uses a Web site program to filter user input and enter HTML that can be displayed on the page to affect other users code to steal user data, take advantage of a user's identity to perform some kind of action, or attack a visitor for viruses. Cross-site scriptin
remember a password, you must set the HttpOnly attribute of the Cookie to true. SpringMVC is used as an example. If the Cookie is used, it should be as follows:
// create cookie and set it in responseCookie cookie1 = new Cookie("cookie1", "cookieValueHttpOnly");Cookie cookie2 = new Cookie("cookie2", "cookieValue");cookie1.setHttpOnly(true); response.addCookie(cookie1);response.addCookie(cookie2);
Take a look at the entire Controller code:
Open the browser to view the following results. Visit t
In addition to the navigateToURL/getURL mentioned in the previous section, another as function that often has XSS defects is ExternalInterface. call. This function serves as the interface for the javascript communication between FLASH and the host page. Generally, there are two parameters. The first parameter is the name of the called js function, other parameters are the parameters of the called js function. When the parameters are controllable, whet
The concept of XSS does not have to say, its harm is great, which means that once your website has an XSS vulnerability, you can execute arbitrary JS code, the most frightening is the attacker to use JS to get a cookie or session hijacking, if this contains a lot of sensitive information (identity information, Administrator information) and so on ...
The following JS gets cookie information:
Copy the Cod
Name: XSS
All-life: Cross-Site Scripting
Why not CSS? Since CSS has been widely used in the field of web design as Cascading Style Sheets, cross is abbreviated as X with similar pronunciation.
Jianghu ranking: 2013 OWASP (Open Web Application Security Project, the official website of https://www.owasp.org/) ranked third.
Summary: cross-site scripting (XSS) is a website application.ProgramIsCod
The concept of XSS is needless to say, its harm is enormous, this means that once your site has an XSS vulnerability, you can execute arbitrary JS code, the most frightening is the attackers use JS to obtain cookies or session hijacking, if this contains a large number of sensitive information (identity information, Administrator information) and so on, that's over.
The following JS get cookie information:
Network Center Tip site has a large number of cross-site scripting attacks (XSS) vulnerability, after reviewing the code, that is, the binding variables in the JSP is not processed directly write, and the whole project is too many, because it is many years ago, not a change, referring to the online information, The data parameters are processed by adding filter.1. Download Lucy-
. HttpOnly
In fact, cookies can be read only through the HTTP protocol (HTTPS can also be used). JavaScript cannot read cookies. Supports IE6 +, Firefox2 +, Google, and Safari4 + browsers.
Java EE adds HttpOnly code to the Cookie:
response.setHeader("Set-Cookie","cookiename=value; Path=/;Domain=domainvalue;Max-Age=seconds;HTTPOnly");
PS: for HTTPS, you can still set the Secure field to encrypt the Cookie securely.
This is essentially not to prevent XSS
The concept of XSS does not have to say, its harm is great, which means that once your website has an XSS vulnerability, you can execute arbitrary JS code, the most frightening is the attacker to use JS to get a cookie or session hijacking, if this contains a lot of sensitive information (identity information, Administrator information) and so on ...
The following JS gets cookie information:
Copy the Code
This article mainly introduces xss defense. php uses httponly to defend against xss attacks. The following describes how to set HttpOnly in PHP. if you need a friend, you can refer to the concept of xss, this means that once your website has an xss vulnerability, attackers can execute arbitrary js code. the most terrib
This article mainly introduces the XSS defense of PHP using HttpOnly anti-XSS attack, the following is the PHP settings HttpOnly method, the need for friends can refer to theThe concept of XSS is needless to say, its harm is enormous, this means that once your site has an XSS vulnerability, you can execute arbitrary JS
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.