当前位置:网站首页>XSS attack
XSS attack
2022-06-25 10:35:00 【m0_ forty-nine million four hundred and seventy-one thousand si】
Scoring point XSS It's a cross site scripting attack 、 Insert malicious code into the target website 、 When a large number of users visit the website, they run malicious scripts to get information Standard answer
XSS It's a cross site scripting attack (Cross Site Scripting), Don't write as CSS To avoid cascading style sheets (Cascading Style Sheets) Confusion of abbreviations , So the cross site scripting attack is written as XSS. An attacker can attack by Web Insert... In the page script Code , When users browse this page , It will run Inserted script Code , To achieve the attacker's purpose .
XSS The harm of is generally to disclose the user's login information cookie, Attackers can get through cookie Bypass the login step and go directly to the site .XSS Is divided into reflection type and storage type . Reflective is temporary passage url Visit website , Website server will malicious code from url Remove from , Spliced in HTML Back to browser , The user will execute malicious code . Storage type is to save malicious code in the server database in the form of message , Anyone who visits the website will be attacked . The prevention of XSS The basic attack scheme is to strictly output code the data , such as HTML Element encoding ,JavaScript code ,css code ,url Encoding, etc. .
The bonus answer is XSS Hazards of :
- obtain cookie: The login in the website is generally in cookie As a proof of identity of a user , This is a string of characters returned by the server . If cookie Got... By the attacker , Then you can bypass the password to log in . When space 、 If the forum can be inserted script Code , Then the account of the person who enters the space or forum can be easily obtained by the attacker . - Malicious jump : Insert... Directly into the page window.location.href To jump .
XSS The classification of :
- reflective XSS( Non-durable type XSS): adopt URL Parameters are injected directly
- Storage type XSS( A persistent XSS): After being stored in the database, it is injected on reading XSS The prevention of :
- Browser defense and “X-XSS-Protection” of , The default value is 1, That is, open by default XSS defense , Can defend against reflective XSS, But the effect is limited , Only defense can be injected into HTML The content or attribute of the node XSS, for example URL Parameter contains script label . It is not recommended to rely solely on this means of defense .
- defense HTML Node content , By means of escape < by < as well as > by > To achieve defense HTML Node content .
- The prevention of HTML attribute , By means of escape "->&quto To achieve defense , Generally do not escape spaces , But this requires the attribute to be quoted .
- The prevention of JavaScript Code , By comparing the data JSON serialize .
- Defending against rich text is a complex project , Because rich text can contain HTML and script, These are difficult to predict and defend , The suggestion is to filter the allowed through the white list HTML Tag and tag attributes to defend , The approximate implementation is : - take HTML The code segment is transformed into tree level data - Traverse every node of the tree , Filter the types and attributes of nodes , Or special treatment - After processing , Transform the tree level structure into HTML Code - Open browser XSS defense :Http Only cookie, prohibit JavaScript Read some sensitive Cookie, The attacker completes XSS It can't be stolen after injection Cookie.
边栏推荐
- 在Microsoft Exchange Server 2007中安装SSL证书的教程
- 新学派:不诈骗经济学
- 成长:如何深度思考与学习
- Mongodb's principle, basic use, clustering and partitioned clustering
- [image fusion] image fusion based on morphological analysis and sparse representation with matlab code
- 西门子PLCS7-200使用(一)---开发环境和组态软件入门
- How do wechat sell small commodity programs do? How to open wechat apps to sell things?
- Flask blog practice - realize personal center and authority management
- How to do the wechat selling applet? How to apply for applets
- Byte interview: under what scenario will syn packets be discarded?
猜你喜欢
Mongodb's principle, basic use, clustering and partitioned clustering
Detailed explanation of Android interview notes handler
【图像融合】基于形态学分析结合稀疏表征实现图像融合附matlab代码
Network protocol learning -- lldp protocol learning
How to make a self-service order wechat applet? How to do the wechat order applet? visual editing
WPF prism framework
1-7Vmware中的快照与克隆
Shardingsphere proxy 4.1 Sous - base de données sous - table
【论文阅读|深读】DRNE:Deep Recursive Network Embedding with Regular Equivalence
Bitmap is converted into drawable and displayed on the screen
随机推荐
Difference between malloc and calloc
Kotlin implements a simple login page
Opencv learning (I) -- environment building
Google Earth engine (GEE) - evaluate enables one click batch download of all single images in the research area (some areas in Shanghai)
Modbus protocol and serialport port read / write
【论文阅读|深读】DRNE:Deep Recursive Network Embedding with Regular Equivalence
新学派:不诈骗经济学
Free applet making tool, how to make wechat applet
NetCore性能排查
tokenizers>=0.11.1,!= 0.11.3,<0.13 is required for a normal functioning of this module,
之前字符串反转的题目
Free platform for wechat applet making, steps for wechat applet making
Output reading: apply what you have learned
【论文阅读|深读】LINE: Large-scale Information Network Embedding
OpenCV学习(二)---树莓派上安装opencv
Comparison and evaluation of digicert and globalsign single domain ov SSL certificates
The title of my composition is - "my district head father"
Array structure collation
Flask blog practice - realize the latest articles and search in the sidebar
WPF binding expression and binding data source (I)