zoukankan      html  css  js  c++  java
  • 提权函数之RtlAdjustPrivilege()

    RtlAdjustPrivilege() 这玩意是在 NTDLL.DLL 里的一个不为人知的函数,MS没有公开,原因就是这玩意实在是太NB了,以至于不需要任何其他函数的帮助,仅凭这一个函数就可以获得进程ACL的任意权限!
    下面是函数定义:

    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); 
    
  • 相关阅读:
    CTO干点啥?
    [转] 持续集成与持续交付备忘录
    [转]概率基础和R语言
    程序自信
    [转]Neural Networks, Manifolds, and Topology
    ubuntu14 + nginx + php
    [转]http://makefiletutorial.com/
    REDIS key notification
    GO RPC
    xpcall 安全调用
  • 原文地址:https://www.cnblogs.com/intcry/p/2020810.html
Copyright © 2011-2022 走看看