Skip to content

Instantly share code, notes, and snippets.

View diversenok's full-sized avatar

diversenok diversenok

View GitHub Profile
@diversenok
diversenok / SafeOpenPromptOriginClaims.h
Created June 3, 2023 14:35
Safe open prompt origin claim definitions
typedef enum _SE_SAFE_OPEN_PROMPT_EXPERIENCE_RESULTS {
SeSafeOpenExperienceNone = 0x00,
SeSafeOpenExperienceCalled = 0x01,
SeSafeOpenExperienceAppRepCalled = 0x02,
SeSafeOpenExperiencePromptDisplayed = 0x04,
SeSafeOpenExperienceUAC = 0x08,
SeSafeOpenExperienceUninstaller = 0x10,
SeSafeOpenExperienceIgnoreUnknownOrBad = 0x20,
SeSafeOpenExperienceDefenderTrustedInstaller = 0x40,
SeSafeOpenExperienceMOTWPresent = 0x80,
@diversenok
diversenok / Readme.md
Last active December 1, 2021 08:29
Testing image relocations

This is a simple program that checks whether image relocations will be applied in kernel or user mode for a particular DLL. Requires PHNT headers to compile.

@diversenok
diversenok / Readme.md
Last active March 8, 2021 20:23
SbieSvc Thread Leak Demo

SbieSvc Thread Leak Demo

The program calls NtImpersonateThread in a loop. Since Sandboxie does not implement this function, each function call triggers it to log a message and leak a thread handle.

You can find the binary below.

@diversenok
diversenok / AssignToken.c
Last active August 3, 2023 13:48
Assign current token to another process.
#include <phnt_windows.h>
#include <phnt.h>
#include <stdio.h>
#define PHNT_VERSION PHNT_WIN7
BOOL IsSuccess(NTSTATUS Status, LPCWSTR Where)
{
if (!NT_SUCCESS(Status))
wprintf_s(L"%s faild with 0x%0.8x", Where, Status);