当前位置:网站首页>教你轻松解决CSRF跨站请求伪造攻击
教你轻松解决CSRF跨站请求伪造攻击
2022-04-21 11:00:00 【InfoQ】
什么是CSRF跨站请求伪造
CSRF的定义
CSRF的分类
- HTML CSRF攻击
- JSON HiJacking攻击
- Flash CSRF攻击
CSRF的攻击过程
- 假设用户A登录银行的网站进行操作,同时也访问了攻击者预先设置好的网站。
- 用户A点击了攻击者网站的某一个链接,这个链接是http://www.bank.com/xxx指向银行,银行服务器根据这个链接携带的参数会进行转账操作。
- 银行服务器在执行转账操作之前会进行Session验证,但是由于用户A已经登录了银行网站,攻击者的链接也是www.bank.com,所以攻击的链接就会携带session到服务器。
- 由于session id是正确的,所以银行会判断操作是由本人发起的,执行转账操作。
CSRF的攻击条件
- 登录受信任网站A,生成可信的Session
- 在不登出A的情况下,访问危险网站B,网站B伪造网站A的请求
CSRF跨站请求伪造的预防方法
验证 HTTP Referer 字段
在请求地址中添加token并验证
在HTTP头中自定义属性并验证
智能云网

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://xie.infoq.cn/article/8aed2b71639f532f057534a4b
边栏推荐
- The PHP file contains: require, require_ once; include,include_ once
- js---call,apply,bind
- Special training of AC automata
- 后缀数组应用
- What if there are not enough mobile phones in Showcase? Cloud real machine platform atxserver2
- MATLAB GUI---复杂绘图模式(动画演示)
- An error occurred while processing your request... enable the Development environment by setting ...
- [interview ordinary people vs Expert Series] understanding of B tree and B + tree
- AcWing 1749. 阻挡广告牌 II(分类讨论+枚举)
- GDI+中TGPImage从流中加载图像
猜你喜欢

println输入和toString方法的重写
![[nonlinear control theory] 1_ Lyapunov direct method](/img/ad/68bceb288d40ae98b60dbb83e0b91d.png)
[nonlinear control theory] 1_ Lyapunov direct method

MATLAB---坐标轴多图片显示
![[非线性控制理论]1_Lyapunov直接方法](/img/ad/68bceb288d40ae98b60dbb83e0b91d.png)
[非线性控制理论]1_Lyapunov直接方法

【生活中的逻辑谬误】对人不对事和两难陷阱

万元礼品奖池 玩转「Lighthouse」有奖征文来袭
Go环境的搭建

O2oa secondary development - use the open source platform to build a complete OA (3) - development enterprise reimbursement approval

Nocalhost for dapr remote debugging

你的思维会改变你的行为,你的行为会改变你的境遇
随机推荐
OpenShift 4 - 提升客户端访问 API Server 安全
An error occurred while processing your request...enable the Development environment by setting ...
O2oa secondary development - use the open source platform to build a complete OA (3) - development enterprise reimbursement approval
@Lookup
从思维转变看数字化转型 IT 经营
O2OA二次开发-使用开源平台搭建完整OA(3)-开发企业报销审批
[TIANTI race] l3-005 dustbin distribution (heap optimized version Dijkstra)
Motor control - speed loop design
ConvBERT: Improving BERT with Span-based Dynamic Convolution论文的阅读笔记
后缀数组专项训练
左程云 - 大厂刷题班 - 一种字符在左,另一种字符在右的最少交换次数
依然AC自动机
【面试普通人VS高手系列】b树和b+树的理解
站长如何防止网站被黑
MATLAB---坐标轴多图片显示
The PHP file contains: require, require_ once; include,include_ once
【天梯赛】L3-010 是否完全二叉搜索树
Activity registration | how to quickly complete the development of data sources and targets based on the open source project tapdata PDK?
AcWing 1725. 组队井字游戏(枚举)
GO函数的使用