TCP 3306: MySQL
MySQL is an open-source relational database management system. Its name is a combination of "My", the name of co-founder Michael Widenius's daughter, and "SQL", the abbreviation for Structured Query Language.
-- Wikipedia
Connection
sudo mysql -u <user>
use <db>;
select * from mysql_func;Remote
mysql -u <user> -p <password> -h <ip> -P <port>Enumeration
Check permissions
show Grants;Show "env"
select @@hostname, @@tmpdir, @@version, @@version_compile_machine, @@plugin_dir;Misc
Read file from file system
User defined functions (UDF)
Run C code and allows basically everything (system calls, etc.)
https://0xdeadbeef.info/exploits/raptor_udf2.c
Compile exploit
Create function in MySQL
Access the database service and select the database to use.
Copy/create the raptor_udf2.so in the directory specified in the plugin_dir variable.
Create the User Defined Function.
Test that the UDF works correctly.
Get root shell (using setuid)
Last updated