当前位置:网站首页>CSRF-Cross-site request forgery-related knowledge
CSRF-Cross-site request forgery-related knowledge
2022-08-02 07:53:00 【Chang Jiazhuang】
What is CSRF?
Cross-site request forgery is referred to as "CSRF". In the CSRF attack scenario, the attacker will forge a request (this request is usually a link), and then trick the target user into clicking. Once the user clicks this request, the entireThe attack is complete.So CSRF attack also becomes "one click" attack.Many people do not understand the concept of CSRF, and sometimes even confuse it with XSS, and even confuse it with the issue of ultra vires, which is caused by the lack of understanding of the principle
CSRF is a common vulnerability in web applications. Its attack characteristics are very harmful but very hidden. Especially in the context of a large number of Web 2.0 technologies, attackers can launch attacks without users noticingCSRF attack.This article will make a systematic exposition of its basic characteristics, attack principles, attack classification, detection methods and prevention methods, and list attack examples
The CSRF attack method is not well known to everyone. In fact, many websites have CSRF security vulnerabilities.As early as 2000, the CSRF attack method has been proposed by foreign security personnel, but in China, it did not begin to receive attention until 2006.In 2008, CSRF loopholes were discovered in many large communities and interactive websites at home and abroad, such as: Baidu HI, NYTimes.com (New York Times), Metafilter (a large BLOG website) and YouTube.But until now, many sites on the Internet are still unprepared for this, so that the security industry calls CSRF a "sleeping giant", and its threat level is evident from this "reputation"
CSRF attack principle
It is to use the session state generated by the attacker to log in to the website, that is, click the malicious link or malicious code constructed by the attacker during the login state. Directly or indirectly, the victim accesses the malicious link or code, thereby reaching the attackerpurpose
A cookie will be generated when a user logs in to the website. This cookie is stored in the browser. When you close the website and reopen the website, you will find that you are still logged in. This means that the cookie authentication has not expired. If it expires, you must log in again., the attacker sends a connection in any form to tempt you, just the user accesses with the browser that stores the cookie for logging in to the website. At this time, since the cookie has not expired and this authentication is obtained, the server will think that the attacker's malicious link is reasonable, that is, the userAt this time, since this link is sent by the user, a CSRF attack is completed.
CSRF Prevention
Check the Referer field and check the token
There is a Referer field in the HTTP header. This field is used to indicate which address the request comes from. According to the source of the Referer field, it is judged whether it is legal to access the page, but adding the Referer field is easy to be tampered with, so adding a token to verify that the token value must beIf it is unpredictable, that is, there is no pattern and a special salt is added, so that if the attacker fills in the token blindly, access is denied
Where to try to exploit CSRF vulnerabilities
- Where to add users
- Data transaction, payment place
- Change password place
- Where to delete data
边栏推荐
猜你喜欢
吃透Chisel语言.30.Chisel进阶之通信状态机(二)——FSMD:以Popcount为例
MySQL error 1055 solution: [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains
The best interests of buying and selling stocks with handling fees [What is missing in the definition of DP status?]
Chain Of Responsibility
MySQL-锁机制
Introduction to mysql operation (4) ----- data sorting (ascending, descending, multi-field sorting)
自然语言处理 文本预处理(下)(张量表示、文本数据分析、文本特征处理等)
Compact格式下MySQL的数据如何存储到磁盘
WebGPU 导入[2] - 核心概念与重要机制解读
自然语言处理 文本预处理(上)(分词、词性标注、命名实体识别等)
随机推荐
【ROS基础】map、odom、base_link、laser 的理解 及其 tf 树的理解
php删除一维数组中一个值
Azure Synapse Analytics上创建用户并赋予权限
暑假第五周总结
About the SQL concat () function problem, how to splice
Go implements distributed locks
自然语言处理 文本预处理(上)(分词、词性标注、命名实体识别等)
SQL server 2014 怎么一次性导出多个查询结果?
正则表达式
LeetCode Algorithm 1374. 生成每种字符都是奇数个的字符串
【CNN回归预测】基于matlab卷积神经网络CNN数据回归预测【含Matlab源码 2003期】
MySQL - Index Optimization and Query Optimization
LeetCode 2312. 卖木头块
Splunk Field Caculated 计算字段
(2022 Nioke Duo School 5) C-Bit Transmission (Thinking)
主流定时任务解决方案全横评
Find the largest n files
MySQL-数据库设计规范
CollectionUtil:一个函数式风格的集合工具
Splunk Filed Alias field name