Exploit database

GH-b4fcac2fac04ffa981cf91040344dd7c

g4sp4rcs/cve-2026-42980-poc

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-42980

1 source

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

Repository files8
g4sp4rcs/cve-2026-42980-pocRevision c396a1355693

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

build.ps1

PowerShell · 2,203 bytes
# CVE-2026-42980 public PoC build script (x64, MSVC)
$ErrorActionPreference = "Stop"

$Root = $PSScriptRoot
if (-not $Root) { $Root = (Get-Location).Path }

$SrcDir = Join-Path $Root "src"
$Src    = Join-Path $SrcDir "cve_2026_42980_lpe.c"
$OutDir = Join-Path $Root "build"
$OutExe = Join-Path $OutDir "poc.exe"

New-Item -ItemType Directory -Force -Path $OutDir | Out-Null

if (-not (Test-Path -LiteralPath $Src)) {
    Write-Host "[-] Source not found: $Src" -ForegroundColor Red
    exit 1
}

$candidateRoots = @(
    [Environment]::GetEnvironmentVariable("ProgramFiles(x86)"),
    [Environment]::GetEnvironmentVariable("ProgramFiles"),
    "C:\Program Files (x86)",
    "C:\Program Files"
) | Where-Object { $_ -and $_.Trim().Length -gt 0 } | Select-Object -Unique

$vsWhere = $null
foreach ($root in $candidateRoots) {
    $candidate = Join-Path $root "Microsoft Visual Studio\Installer\vswhere.exe"
    if (Test-Path -LiteralPath $candidate) {
        $vsWhere = $candidate
        break
    }
}

if (-not $vsWhere) {
    Write-Host "[-] vswhere.exe not found. Install Visual Studio Build Tools with the C++ workload." -ForegroundColor Red
    exit 1
}

$vsPath = & $vsWhere -latest -property installationPath 2>$null
$vcvars = Join-Path $vsPath "VC\Auxiliary\Build\vcvarsall.bat"
if (-not (Test-Path -LiteralPath $vcvars)) {
    Write-Host "[-] vcvarsall.bat not found. Install the MSVC x64 toolchain." -ForegroundColor Red
    exit 1
}

$bat = @"
@echo off
call "$vcvars" x64 >nul 2>&1
cd /d "$OutDir"
cl.exe /nologo /W3 /O2 /TP /EHsc /D_CRT_SECURE_NO_WARNINGS /Fe:"$OutExe" "$Src" /link Cfgmgr32.lib User32.lib ole32.lib ntdll.lib
"@

$batFile = Join-Path $OutDir "_build_public_poc.bat"
$bat | Set-Content -LiteralPath $batFile -Encoding ASCII

Write-Host "[*] Building CVE-2026-42980 public PoC (x64)..." -ForegroundColor Cyan
& cmd.exe /c $batFile
$exit = $LASTEXITCODE
Remove-Item -LiteralPath $batFile -ErrorAction SilentlyContinue

if ($exit -eq 0 -and (Test-Path -LiteralPath $OutExe)) {
    Write-Host "[+] Built: $OutExe" -ForegroundColor Green
    exit 0
}

Write-Host "[-] Build failed" -ForegroundColor Red
exit 1