PORT 3306/tcp MySQL

Privilege Escalation

Once we have a database user, some configuration is needed to be checked.

Grants

Look what privileges have the user.

show GRANTS;

Variables

Take a look to the defined variables, sometimes has valuable information.

show VARIABLES;
show VARIABLES LIKE '%version%';
show VARIABLES LIKE '%plugin_dir%';
show VARIABLES LIKE '%tmp%';
show VARIABLES LIKE '%hostname%';

RCE via Library (lib_mysqludf_sys.so)

To do that task mysql root user is needed or another user with FILE permissions.

Shellcode (@shell)

  • 32 bits: x86

  • 64 bits: x64

Exploitation

Configurate the server with the following commands.

Execute code using the sys_exec function.

Last updated

Was this helpful?