zero-sec / lib_mariadbudf_sys

A UDF library with functions to interact with the operating system. These functions allow you to interact with the execution environment in which MariaDB runs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UDF Repository for MariaDB

A UDF library with functions to interact with the operating system. These functions allow you to interact with the execution environment in which MariaDB runs.

Build

docker build .
CID=$(docker create lib_mariadbudf_sys)
docker cp ${CID}:/build/lib_mysqludf_sys/lib_mariaudf_sys.so .
docker rm ${CID}

Install

copy lib_mariaudf_sys.so to mariadb's plugin directory, then run:

create function sys_exec returns int soname 'lib_mysqludf_sys.so';
create function sys_eval returns string soname 'lib_mysqludf_sys.so';

Using

select sys_eval('uname -a')

Security Precautions

UDFs are available to all database users - you cannot grant EXECUTE privileges for them. As the command string passed to sys_exec or sys_eval can do pretty much everything, exposing the function poses a real security hazard.

About

A UDF library with functions to interact with the operating system. These functions allow you to interact with the execution environment in which MariaDB runs.


Languages

Language:Dockerfile 75.5%Language:Shell 24.5%