Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
UpdateWindowsRE-CVE-2022-41099 — Script to update Windows Recovery Environment to patch against CVE-2022-41099 | Kitploit
Tools/GitHubGitHub/tylermontneyacc/updatewindowsre-cve-2022-41099
Vulnerability ScannersVulnerability AnalysisConfiguration AuditingCloud SecurityMisconfigurationIncident Response
GitHubtylermontneyacc/updatewindowsre-cve-2022-41099

UpdateWindowsRE-CVE-2022-41099

Script to update Windows Recovery Environment to patch against CVE-2022-41099

View Repository
2323 years agoNot yet reviewed
Share

Overview

Forked from u/InternetStranger4You with some considerable changes.

Layout

Code is split between two modules:

  • Microsoft.Windows.PSGeneral
    • Wrapper code for DISM and ReAgentC
    • Extended tests for pending reboot
    • Automatic resizing/rebuilding of Windows RE partition
  • Microsoft.Windows.PSMitSec
    • Incorporating Microsoft.Windows.PSGeneral
    • Retrying Add-DismPackage, if necessary
    • Expanding the Windows RE partition, if necessary

Of course, the modules are for demonstration purposes. If you wish to use them properly, you should create manifest files and reference dependencies appropriately.

Logging

PSFramework is used instead of the built-in cmdlets.

Notes

  • Add-DismPackage always seems to fail once. The error message itself says it could be a temporary error (such as a race condition to update the Service Stack). Retrying after a few seconds always succeeds.
    • It was suggested that this could be due to in-place feature upgrades. I noticed this on a fresh install of Windows 10 21H2.
  • As mentioned under Layout, this script will automatically resize the Windows Recovery (WinRE) partition (if specified). By resize, I mean delete and rebuild.
    • Requires a GPT disk. Not that you can't use MBR, it's just I didn't feel like figuring that one out. Most disks should be GPT by now.
    • Requires an existing WinRE partition. This is to re-use the existing Winre.wim file. The .wim is present nowhere else locally. (Of course, the script itself would require one; otherwise, there's nothing to patch.)
  • Implement Test-PSMitSec_CVE202241099

TO-DO

Important

  • See if the patch is applied before updating.
    • Applying it again won't cause it to fail.
    • Patch can take a few minutes to apply. Microsoft Intune seems to run scripts more than once, so this would save time.
  • When Add-DismPackage fails for the first time, it outputs a ton of progress bar text (looks very messy). It should be suppressed.
  • Add parameter for Resize-WinREPartition to accept Winre.wim from alternate source (such as flash drive with install media).

Not-so Important

  • Improve variable/function names
  • Remove unnecessary variable initializations (I tend to write PS like C#)
  • Move some output from Verbose to Host
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    911
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    548
  • 3

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    366
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    362
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    311
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    287

Explore all tools

Browse our collection of tools

View all tools →