利用未文档化API:RtlAdjustPrivilege 提权实现自动关机
这里主要是利用NTDLL.dll中未文档化的API:
RtlAdjustPrivilege
来实现提权、自动关机的功能。
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.
// 输出原来相应权限的状态(打开 | 关闭)
#include <iostream>
#include <windows.h>
#include <string> using namespace std; const unsigned long SE_DEBUG_PRIVILEGE = 0x13;
typedef int(_stdcall *_RtlAdjustPrivilege)(int, BOOL, BOOL, int *);
typedef int(_stdcall *_ZwShutdownSystem)(int); int main(int argc, char* argv[])
{
HMODULE hNtDll = LoadLibrary("NTDLL.dll");
if (!hNtDll)
cout << "Error.." << endl;
_RtlAdjustPrivilege pfnRtlAdjustPrivilege = (_RtlAdjustPrivilege)GetProcAddress(hNtDll, "RtlAdjustPrivilege");
_ZwShutdownSystem pfnZwShutdownSystem = (_ZwShutdownSystem)GetProcAddress(hNtDll, "ZwShutdownSystem"); int nEn = ;
pfnRtlAdjustPrivilege(SE_DEBUG_PRIVILEGE, TRUE, FALSE, &nEn);
pfnZwShutdownSystem(); return ;
}
利用未文档化API:RtlAdjustPrivilege 提权实现自动关机的更多相关文章
- 利用未文档化API:RtlGetNtVersionNumbers 获取系统版本号
问题一:Windows SDK 8.1版本中的VersionHelper.h文件当中没有IsWindows10ORGreater,所以当你用IsWindows8Point1ORGreater判断出版本 ...
- NTDLL未文档化函数RtlGetNtVersionNumbers获取操作系统版本
作为新手,对获取操作系统版本号好奇过,因为曾经假象过一个场景:自己的程序在windows xp环境下编译,在windows 2003, windows 7,windows 8是否需要提权或者兼容处理, ...
- 使用 Swagger 文档化和定义 RESTful API
大部分 Web 应用程序都支持 RESTful API,但不同于 SOAP API——REST API 依赖于 HTTP 方法,缺少与 Web 服务描述语言(Web Services Descript ...
- 使用.NET 6开发TodoList应用(27)——实现API的Swagger文档化
系列导航及源代码 使用.NET 6开发TodoList应用文章索引 需求 在日常开发中,我们需要给前端提供文档化的API接口定义,甚至需要模拟架设一个fake服务用来调试接口字段.或者对于后端开发人员 ...
- Effective Java 第三版——74. 文档化每个方法抛出的所有异常
Tips 书中的源代码地址:https://github.com/jbloch/effective-java-3e-source-code 注意,书中的有些代码里方法是基于Java 9 API中的,所 ...
- 使用Xcode HeaderDoc和Doxygen文档化你的Objective-C和Swift代码
在一个应用的整个开发过程中涉及到了无数的步骤.其中一些是应用的说明,图片的创作,应用的实现,和实现过后的测试阶段.写代码可能组成了这个过程的绝大部分,因为正是它给了应用生命,但是这样还不够,与它同等重 ...
- sphinx-python文档化
概述 下文讲述使用sphinx自动生成reStructuredText python API文档的简单过程. 配置流程 安装依赖 $ pip install sphinx blurb python-d ...
- 在线文档转换API word,excel,ppt等在线文件转pdf、png
在线文档转换API提供word,excel,ppt等在线文件转pdf.png等,文档:https://www.juhe.cn/docs/api/id/259 接口地址:http://v.juhe.cn ...
- tbls ci 友好的数据库文档化工具
tbls 是用golang 编写的数据库文档化工具,当前支持的数据库有pg.mysql.bigquery 此工具同时提供了变更对比.lint 校验,生成是markdown格式的 简单使用 安装 mac ...
随机推荐
- A - Space Elevator(动态规划专项)
A - Space Elevator Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u ...
- C++ socket programming in Linux
Server.c #include <arpa/inet.h> #include <errno.h> #include <netinet/in.h> #includ ...
- 向.net后端发送请求获取数据,在前端动态填充表格
实现效果 实现步骤 通过Ajax请求的方式 1.在前端定义Table 2.通过Ajax向.net后端发送数据请求 3.在.net后端定义方法供前端调用,并返回所需的数据 4.通过构造字符串的方式,将后 ...
- wordpress建站过程2——结构
开始wordpress之前,我们需要了解,wordpress的结构和调用方式. 当一个wordpress开始之后,他会读取[当前主题]的index.php.所以一旦主题切换了,它读的就是其他主题的in ...
- django搭建Bootstrap常用问题解决方法
1.进入页面,提示Creating a ModelForm without either the 'fields' attribute or the 'exclude'时 解决方法:打开forms.p ...
- HTTP 返回状态值详解
当用户点击或搜索引擎向网站服务器发出浏览请求时,服务器将返回Http Header Http头信息状态码,常见几种如下: 1.Http/1.1 200 OK 访问正常 表示成功访问,为网站可正常访问 ...
- maven 代理
切换到{maven.home}\conf (ie: maven 安装目录) 拷贝settings.xml到自己的.m2目录 编辑.m2/settings.xml的代理部分: <proxy> ...
- hdu_5763_Another Meaning(dp)
题目链接:hdu_5763_Another Meaning 题意: 一个文本串A,一个模式串B,如果文本串含有模式串B,那么就能组合成多种意思,如下: In the first case, “ heh ...
- mvc Controller类介绍
1.Controller类 i.Controller必须为公开类: ii.必须以Controller结尾: iii.继承Controller基类或实现IController接口的类: iv.类中必须包 ...
- Software Version
Software Version Time Limit : 3000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) To ...