当前位置:网站首页>CSRF attack
CSRF attack
2022-06-25 10:35:00 【m0_ forty-nine million four hundred and seventy-one thousand si】
Scoring point CSRF Time Cross Site Request Forgery 、 Steal user identity to initiate request Standard answer
CSRF Cross-site request forgery (Cross Site Request Forgery) and XSS The attack is the same , There is great harm , The attacker stole the user's identity , Send malicious request as user , But for the server, the request is reasonable , This completes the attacker's goal .
CSRF The process principle of attack is : - The user opens the browser , Visit the target website A, Enter a user name and password to request login - After the user information passes the authentication , Website A Produce a cookie The information is returned to the browser , At this time, users can normally send requests to the website A - The user is not exiting the website A Before that, another new website was opened in the same browser B. - New website B Some attack codes are returned after receiving the user request , And send a request for access to return cookie Website A - After the browser receives these offensive codes, it will launch the new website B The request of is operated with the user's permission without the user's knowledge cookie And to the website A The server initiated a legitimate request .
The prevention of CSRF The main attack strategies are as follows :
- Use verification code , Add a random number or letter verification code to the form , Enforce direct interaction between users and applications .
- HTTP in Referer Field , Check whether it is accessed from the correct domain name , It records HTTP Requested Source address .
- Use token verification , stay HTTP Add... To the request header token Field , And establish an interceptor on the server side to verify this token, If token incorrect , Just refuse the request .
The bonus answer is
verification HTTP Referer The advantage of fields is that they are very simple to implement , Ordinary website development does not need to be particularly worried CSRF Loophole , Just set up an interceptor at the back to verify referer The value of , There is no need to change the existing code logic , Very convenient . But this method is not foolproof , although referer It's provided by the browser , But different browsers may be referer There are more or less vulnerabilities in the implementation of , So use referer The security guarantee of is realized through the browser . Use token The method of verification is better than referer It's safer , Need to put token In a HTTP Custom request header , Solved the use of get perhaps post The inconvenience of parameter transmission .
边栏推荐
- [image fusion] image fusion based on morphological analysis and sparse representation with matlab code
- 之前字符串反转的题目
- 单片机开发---基于ESP32-CAM的人脸识别应用
- 新学派:不诈骗经济学
- 《天天数学》连载52:二月二十日
- How to develop wechat applet? How to open a wechat store
- The title of my composition is - "my district head father"
- Growth: how to think deeply and learn
- OpenCV学习(一)---环境搭建
- Array structure collation
猜你喜欢
Opencv learning (II) -- installing opencv on raspberry pie
Deep understanding of JVM - JVM memory model
看完这篇 教你玩转渗透测试靶机Vulnhub——DriftingBlues-7
Linked list delete nodes in the linked list
【RPC】I/O模型——BIO、NIO、AIO及NIO的Rector模式
[dynamic planning] - Digital triangle
The real difference between i++ and ++i
Chinese translation of IMA Lazarus' the new giant, the goddess of Liberty
[RPC] i/o model - Rector mode of bio, NiO, AIO and NiO
Floating window --- create an activity floating window (can be dragged)
随机推荐
Handler asynchronous message processing
Bitmap is converted into drawable and displayed on the screen
Tutorial on installing SSL certificates in Microsoft Exchange Server 2007
Daily Mathematics Series 52: February 20
输出式阅读法:把学到的知识用起来
Flask博客实战 - 实现个人中心及权限管理
How to develop wechat applet? How to open a wechat store
数组结构整理
[RPC] i/o model - Rector mode of bio, NiO, AIO and NiO
【动态规划】—— 数字三角形
Oracle查询自带JDK版本
CSRF攻击
How to make a self-service order wechat applet? How to do the wechat order applet? visual editing
How do wechat sell small commodity programs do? How to open wechat apps to sell things?
Unreal Engine graphics and text notes: use VAT (vertex animation texture) to make Houdini end on Houdini special effect (ue4/ue5)
How to apply for a widget on wechat how to get a widget on wechat
Flask博客实战 - 实现侧边栏文章归档及标签
Houdini图文笔记:Could not create OpenCL device of type (HOUDINI_OCL_DEVICETYPE)问题的解决
如何在Microsoft Exchange 2010中安装SSL证书
【论文阅读|深读】LINE: Large-scale Information Network Embedding