Mysql 5.0.12 Exploit Verified ✮ | RECENT |
While early discussions often pointed to MySQL 5.0.12 as being vulnerable, the formal identifier for this critical issue is . This vulnerability was discovered and reported by security researchers Josh Berkus and Tom Lane.
The response came back: this_is_a_test . He had file system write access.
: Under specific conditions, a token with a length mismatch or an unexpected null byte causes the function to return a zero, which the server interprets as a successful password match. mysql 5.0.12 exploit
He waited five minutes. Then he probed the file via a second injection:
for MySQL 5.0.12 is immediate upgrade . All of the vulnerabilities described above have been fixed in later versions: While early discussions often pointed to MySQL 5
He deleted the DLL from the filesystem using a final sys_eval('del C:\\MySQL\\lib\\plugin\\udf.dll') . He removed the backdoor user. He overwrote the test.txt file with garbage. He flushed the MySQL query logs—which, on this ancient version, were stored in C:\\MySQL\\data\\mysql.log —by writing a script that looped 10,000 SELECT 1; statements to bury his injection.
: If the database only serves applications on the same machine, configure MySQL to only listen on the loopback interface. In the my.cnf or my.ini file, set: bind-address = 127.0.0.1 Use code with caution. Restrict the File System Access He had file system write access
Using the INTO DUMPFILE or INTO OUTFILE commands to write a malicious binary to a directory where the server could load plugins.
Target: db-02-prod.internal.financials.corp MySQL Version: 5.0.12-standard-log (Detected via passive fingerprinting)
' UNION SELECT 'this_is_a_test' INTO OUTFILE 'C:\\MySQL\\data\\test.txt' --
: Attackers use a simple bash loop to attempt a login hundreds of times. Statistically, they will gain access within a few seconds without ever knowing the real password. 3. SQL Injection and Stacked Queries