Exploit databaseDownload repository ZIP
GH-8bd5347d306a4b933f7500f7bf5906e1
j0wii/cve-2026-97798_lpe_windows
Sources for CVE-2026-97798
2 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files8
j0wii/cve-2026-97798_lpe_windowsRevision b8a799b8fbd2
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
build.ps1
PowerShell · 2,626 bytes<#
Builds CVE-2026-97798.exe (lean) and CVE-2026-97798-diag.exe from one source.
Requirements: an x64 Windows toolchain that can produce a static PE.
Tested with:
* LLVM-MinGW x86_64-w64-mingw32-clang++.exe
* MinGW-w64 x86_64-w64-mingw32-g++.exe
Usage:
.\build.ps1
.\build.ps1 -Compiler C:\toolchains\llvm-mingw\bin\x86_64-w64-mingw32-clang++.exe
#>
[CmdletBinding()]
param(
[string]$Compiler = ""
)
$ErrorActionPreference = "Stop"
$root = Split-Path -Parent $MyInvocation.MyCommand.Path
$src = Join-Path $root "src\CVE-2026-97798.cpp"
$bin = Join-Path $root "bin"
if (-not $Compiler) {
foreach ($candidate in @("x86_64-w64-mingw32-clang++.exe", "x86_64-w64-mingw32-g++.exe")) {
$found = Get-Command $candidate -ErrorAction SilentlyContinue
if ($found) { $Compiler = $found.Source; break }
}
}
if (-not $Compiler) {
throw "no x64 toolchain found in PATH; pass -Compiler <path to x86_64-w64-mingw32-clang++ or g++>"
}
New-Item -ItemType Directory -Force -Path $bin | Out-Null
$common = @(
"-std=c++20", "-O2", "-static", "-municode",
"-Wall", "-Wextra", "-Wno-unused-parameter",
"-Wl,--no-insert-timestamp"
)
$libs = @("-lole32", "-loleaut32", "-ladvapi32", "-lversion")
Write-Host "compiler: $Compiler"
& $Compiler @common "-DCVE97798_LEAN" $src "-o" (Join-Path $bin "CVE-2026-97798.exe") @libs
if ($LASTEXITCODE -ne 0) { throw "lean build failed" }
& $Compiler @common $src "-o" (Join-Path $bin "CVE-2026-97798-diag.exe") @libs
if ($LASTEXITCODE -ne 0) { throw "diagnostic build failed" }
# Optional: strip symbols to roughly halve the image. The resolver parses the
# loaded faultrep.dll, not this image, so stripping does not affect behaviour.
$strip = $null
foreach ($candidate in @("x86_64-w64-mingw32-strip.exe", "llvm-strip.exe", "strip.exe")) {
$found = Get-Command $candidate -ErrorAction SilentlyContinue
if ($found) { $strip = $found.Source; break }
}
if ($strip) {
Get-ChildItem (Join-Path $bin "*.exe") | ForEach-Object {
$tmp = "$($_.FullName).stripped"
& $strip "--strip-all" "-o" $tmp $_.FullName
if ($LASTEXITCODE -eq 0 -and (Test-Path $tmp)) { Move-Item -Force $tmp $_.FullName }
elseif (Test-Path $tmp) { Remove-Item -Force $tmp }
}
Write-Host "stripped with $strip"
} else {
Write-Host "no strip tool found; binaries keep their symbol table"
}
Get-ChildItem $bin | Select-Object Name, Length | Format-Table -AutoSize
Get-FileHash (Join-Path $bin "*.exe") -Algorithm SHA256 |
ForEach-Object { "$($_.Hash.ToLower()) $(Split-Path $_.Path -Leaf)" }