赞
踩
主要看了Corben Leo的Advanced CORS Exploitation Techniques这篇文章,对这篇文章的一个翻译吧,收获良多,复现一下cors漏洞的进阶利用。直入正题。
这里就借OWASP的关于CORS的介绍。
CORS stands for Cross- Origin Resource Sharing.
Is an feature offering the possbility to:
This article will focus on HTTP Request Preflight feature proposed by CORS W3C specification and (mainly) how to setup a protection, on web application side, against CORS HTTP request that try to bypass the preflight process. 简单的来说,它是为了跨域资源共享,web开发者可以通过发送AJAX请求不同域下的资源。关于CORS的利用可以参考这篇文章《cors安全完全指南》。
受害者服务器配置CORS策略,在nginx.conf server下增加以下配置(当然你也可以直接在代码中设置):
- location / {
- add_header Access-Control-Allow-Origin $http_origin;
- add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
- add_header Access-Control-Allow-Credentials true;
- if ($request_m
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。