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
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
- You to WinHostPEAS: Run the script, ideally elevated
- WinHostPEAS: Detect elevation, note any gaps
- WinHostPEAS to Local host state: Read registry, WMI, sockets, files
- Local host state to WinHostPEAS: Current settings
- WinHostPEAS to Findings engine: Finding with severity and fix
- Findings engine: Redact any secret values
- Findings engine to Report folder: Write JSON, CSV and HTML
- WinHostPEAS to You: Exit code: Critical plus High count
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 countTech 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
# 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 -NoLaunchSource code
The code is public. View the WinHostPEAS repository on GitHub.
Related
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 servicesFree tools built the same way
More builds
- AI Stack CVE Labs: Security research
- Agentic Agency: Agent framework
- AI Usage Dashboard: AI infrastructure and operations
- Geo-Intel: Data pipeline
- Security Knowledge Base: Knowledge base
- RapidAPI MCP: API integration
- Claude Budget: AI spend control
- Flightdeck: Agent operations
- Niagara BQL and NEQL Reference: OT reference
- IG Sanitize: Privacy tool
Last updated 2026-11-11