CYBERAUTOMATIONSStart a project
Security toolingOpen source

A read-only Windows security posture audit, rebuilt from winPEAS for blue teams

A single PowerShell script that audits one Windows host the way an attacker would enumerate it, then reports each weakness with a severity and a fix. It reads local state only, changes nothing on the host, redacts every secret it finds, and writes JSON, CSV and HTML reports.

network packets sent
0
check sections, one opt-in
22
report formats: JSON, CSV, HTML
3

The problem

winPEAS is the script attackers run after landing on a Windows host to find a way up. Defenders want the same view of their own machines, but winPEAS prints passwords and WiFi keys to the console, suggests attack tools, and gives no severity or fix for what it finds.

A hardening audit also has to be safe to run on production servers and across a fleet. That rules out anything that scans the network, queries a domain controller, or changes a setting while it looks.

The approach

  1. We kept the enumeration surface of winPEAS.ps1 and turned each check around. Every check calls one collector, so each finding has the same fields: time, host, severity, category, title, detail, evidence and remediation.
  2. Checks read the registry, WMI, the local socket tables and local files. The script sends no pings, port scans or directory queries. The external commands it runs are read-only ones such as auditpol /get, secedit /export, bcdedit /enum and sc.exe sdshow.
  3. The secret patterns from winPEAS are kept for detection only. A match is recorded as its length and last four characters plus where it lives, so you can rotate the secret without the report leaking it.
  4. The script detects whether it is running as administrator. A check that needs elevation and does not have it reports 'not assessed', so a check that could not run never looks like a pass.
  5. Permission checks compare by SID against low-privilege groups, so results are the same on any Windows display language and do not depend on who runs the audit.
  6. Beyond the winPEAS surface it adds defender-side sections: Defender and logging posture, IIS and web.config review, OT protocol listeners, persistence slots, an image hardening baseline and an asset inventory of services, programs and program folders.
  7. The shipped tool is one file. A build script joins the source modules in a fixed order, checks that the result parses, strips comments and checks again.

How it flows

YouWinHostPEASLocal host stateFindings engineReport folderRun the script, ideally elevatedDetect elevation, note any gapsRead registry, WMI, sockets, filesCurrent settingsFinding with severity and fixRedact any secret valuesWrite JSON, CSV and HTMLExit code: Critical plus High count
  1. You to WinHostPEAS: Run the script, ideally elevated
  2. WinHostPEAS: Detect elevation, note any gaps
  3. WinHostPEAS to Local host state: Read registry, WMI, sockets, files
  4. Local host state to WinHostPEAS: Current settings
  5. WinHostPEAS to Findings engine: Finding with severity and fix
  6. Findings engine: Redact any secret values
  7. Findings engine to Report folder: Write JSON, CSV and HTML
  8. WinHostPEAS to You: Exit code: Critical plus High count
One audit run on one host. Nothing leaves the machine except the report files you ask for. Solid arrows are requests, dashed arrows are replies.
Show this diagram as Mermaid text
sequenceDiagram
    participant P0 as You
    participant P1 as WinHostPEAS
    participant P2 as Local host state
    participant P3 as Findings engine
    participant P4 as Report folder
    P0->>P1: Run the script, ideally elevated
    P1->>P1: Detect elevation, note any gaps
    P1->>P2: Read registry, WMI, sockets, files
    P2-->>P1: Current settings
    P1->>P3: Finding with severity and fix
    P3->>P3: Redact any secret values
    P3->>P4: Write JSON, CSV and HTML
    P1-->>P0: Exit code: Critical plus High count

Tech stack

Language
PowerShell, one self-contained script with no dependencies
Targets
Windows Server 2019, 2022 and 2025, Windows 10 and 11, IIS
Data sources
Registry, WMI and CIM, local socket tables, file ACLs, Microsoft.Web.Administration
Reports
JSON, CSV, a single-file HTML dashboard, three inventory CSVs
Build
build.ps1 with the PowerShell AST parser
License
GPL v2 or later, derived from PEASS-ng winPEAS

Results

  • One run produces a console summary, a JSON file, a CSV file, an HTML dashboard with search and severity filters, and three inventory CSVs.
  • The exit code is the number of Critical and High findings, capped at 250, so a scheduler or deployment tool can sort hosts without parsing any output.
  • An opt-in deep run sweeps a fixed set of credential folders and registry areas for secret patterns, with every value redacted.
  • The same script works as a regression test for a golden image: fix a finding, run again, and the exit code falls.
  • We do not publish detection rates or fleet figures for this tool. The code is public, and both the read-only and the nothing-sent claims can be checked by searching the single shipped script.

Every figure on this page comes from the project's own code, tests or notes. Where there is no measured number, we describe the outcome in words.

Demo

PowerShell
# Fast posture audit
pwsh -File WinHostPEAS.ps1 -OutputDir .\WinHostPEAS_Output

# Deep run: adds a scoped, redacted secret-pattern sweep
pwsh -File WinHostPEAS.ps1 -OutputDir \\server\share\audits -FullCheck -TimeStamp

# Unattended: do not open the HTML report, triage on the exit code
pwsh -NoProfile -File WinHostPEAS.ps1 -FullCheck -NoLaunch
The two common ways to run it, from the README.

Source code

The code is public. View the WinHostPEAS repository on GitHub.

Service

Compliance-aware operations automation

Dispatch, documentation capture and billing QA for regulated workflows, built on platforms your team already has.

See all custom build services

More builds

Last updated 2026-11-11

Want something like this on your data?

Tell us what you want automated. If it fits, we will tell you exactly what it looks like and what it costs.