软件编程
位置:首页>> 软件编程>> C#编程>> 提权函数之RtlAdjustPrivilege()使用说明

提权函数之RtlAdjustPrivilege()使用说明

  发布时间:2021-08-27 04:16:49 

标签:RtlAdjustPrivilege,提权

下面是函数定义:


NTSTATUS RtlAdjustPrivilege
(
ULONG Privilege,
BOOLEAN Enable,
BOOLEAN CurrentThread,
PBOOLEAN Enabled
)


参数的含义:
Privilege [In] Privilege index to change.
// 所需要的权限名称,可以到MSDN查找关于Process Token & Privilege内容可以查到

Enable [In] If TRUE, then enable the privilege otherwise disable.
// 如果为True 就是打开相应权限,如果为False 则是关闭相应权限

CurrentThread [In] If TRUE, then enable in calling thread, otherwise process.
// 如果为True 则仅提升当前线程权限,否则提升整个进程的权限

Enabled [Out] Whether privilege was previously enabled or disabled.
// 输出原来相应权限的状态(打开 | 关闭)

用法很简单:


#define SE_DEBUG_PRIVILEGE 0x14 //DEBUG 权限
int s;
RtlAdjustPrivilege(SE_DEBUG_PRIVILEGE,true,false,&s);
0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com