CORS跨域访问
class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
- CORS的两种请求方式
请求方式为OPTIONS,这个请求是来询问的,请求头要包含以下字段
class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
发送的origin和返回的origin一样,acao为true,就存在漏洞 class="ztext-empty-paragraph">
Referer检查,这种情况下可以通过某处的xss漏洞进行绕过检查 class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
补充: CORS的规范中还提到了“NULL“源。触发这个源是为了网页跳转或者是来自本地HTML文件。 目标应用可能会接受NULL源,并且这个可能被测试者利用,任何网站很容易使用沙盒iframe来获取null源 class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
第一个箭头下的链接是攻击者保存的地址 第二个箭头下的链接是本地服务器的地址 class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
·靶场演示
class="ztext-empty-paragraph">
他会跳转到demo2_1.php下,cookie也会带着到这里 class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
这时就可以构造钓鱼邮件发送给受害者去点击刷新 class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
F12查看,可以看到向外发起请求 class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
再回到文件处,发现创建了一个文件 class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
·Wordpress cors
class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
然后复制这个链接,补全这个url,可以看到返回出来的json数据 class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
在请求包中加入origin头192.168.10.31,再次发送,发现响应消息中ACAO已经变成了origin的头,并且ACAC为true。从而证明了是存在cors跨域漏洞的。 class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
生成一个HTML内容,放入vps下,起一个名字。 class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
然后诱骗受害者点击,就会把json数据发送到你的服务器,从而获取对方的敏感信息 class="ztext-empty-paragraph">
class="ztext-empty-paragraph">
|