Phpmyadmin Hacktricks ((exclusive))
SELECT '' INTO OUTFILE '/var/www/html/shell.php'; Use code with caution. User Defined Functions (UDF) Code Execution
SELECT '' INTO OUTFILE '/var/www/html/shell.php'; Use code with caution.
Multiple SQL injection vulnerabilities have been discovered in phpMyAdmin:
Because it acts as a direct bridge to a system's data tier, it remains a high-value target for security researchers and malicious actors alike. When misconfigured or unpatched, phpMyAdmin can give an attacker a direct vector to read sensitive system configuration files, execute arbitrary code, and achieve full system compromise. phpmyadmin hacktricks
Attackers first look for exposed interfaces and weak access controls. Default Credentials : Common combinations include blank password or the password set to "password" Dictionary Attacks : Tools like Burp Intruder or Metasploit's auxiliary/scanner/http/phpmyadmin_login can automate login attempts against the /phpmyadmin/ /phpMyAdmin/ directories. Shodan Dorking : Searching for title:"phpMyAdmin" can reveal publicly accessible instances. 2. Information Gathering
SELECT '<?= "<?php system('ls');" ?>' INTO OUTFILE '/var/www/html/shell.php';
: Common default directories include /phpmyadmin/ , /pma/ , and /setup/ . Version Identification : SELECT ' ' INTO OUTFILE '/var/www/html/shell
Administrators often leave phpMyAdmin on predictable directories. Security professionals use fuzzing tools like gobuster , dirsearch , or ffuf to scan for common endpoints: /phpmyadmin/ /pma/ /admin/pma/ /mysql/ /phpMyAdmin/ /dbadmin/ Version Fingerprinting
In some misconfigured environments, the phpMyAdmin config.inc.php file is set up to use the config authentication type instead of cookie or http . This automatically logs in any visitor as a pre-configured user (often root ) without prompting for a username or password. 3. Exploitation Techniques (Post-Authentication)
In older versions, a vulnerability existed where /etc/phpmyadmin/htpasswd.setup could be read or bypassed. Modern attacks focus on brute-force. When misconfigured or unpatched, phpMyAdmin can give an
Ensure the MySQL user used by phpMyAdmin does not have the FILE privilege.
Knowing the exact software version dictates the exploit path. You can identify the version using:
: Execute the query SHOW VARIABLES LIKE "secure_file_priv"; .
