
PrivescCheck is a PowerShell script that enumerates common Windows misconfigurations and privilege escalation paths during authorized assessments, producing structured TXT, HTML, CSV, or XML reports.
| Tool | itm4n/PrivescCheck — PowerShell privilege escalation enumeration script for Windows, ~3.9k stars, BSD-3-Clause |
| Category | Windows local privilege escalation enumeration / post-exploitation recon |
| Primary Use | Running Invoke-PrivescCheck as a low-privileged user during authorized penetration tests to surface vulnerable services, weak permissions, and config issues |
| Safe Use | Intended exclusively for authorized penetration tests, red-team engagements with written scope, lab environments, and hardening/configuration audits of systems you own or administer |
| Telemetry Note | The script deliberately separates risky checks (-Risky) that are likely to trigger active EDR countermeasures; ordinary runs spawn powershell.exe activity, execution-policy bypass commands, and report file writes that defenders can monitor |
PrivescCheck, maintained by itm4n, is a single-file PowerShell enumeration tool that hunts for common Windows privilege escalation vulnerabilities and configuration issues that often fall outside the coverage of public security baselines. With nearly four thousand stars and a BSD-3-Clause license, it has become a standard item in the working set of penetration testers operating on Windows targets during authorized engagements. The tool is written purely in PowerShell, which matters operationally: it needs no external binaries, no compilation, and no agent deployment, only a powershell.exe process and the ability to dot-source a single .ps1 file. Its positioning is deliberately narrower than a general audit framework — the README describes the goal as identifying weaknesses and collecting information useful for exploitation and post-exploitation work, which is precisely the niche a tester occupies after obtaining an initial low-privileged foothold.
The architectural decision that defines the tool is stated prominently in the README: all access control checks are performed in the context of the current user. This is not a static rule engine that scans registry hives against a hardening baseline; it actively probes whether the account it runs under can actually read, write, or execute the things it finds. The direct consequence, and one the author flags as important, is that running the script with administrator privileges causes most vulnerability checks to be skipped to avoid generating false positives. The script will normally halt outright if elevated, and only the -Force flag overrides that guard. For an operator, this is a well-reasoned design: findings reflect what your current principal can genuinely abuse, not theoretical weaknesses.
Invocation is centered on a single cmdlet, Invoke-PrivescCheck, with a small set of switches that control depth. The minimal form looks like powershell -ep bypass -c ". .\PrivescCheck.ps1; Invoke-PrivescCheck -Report TXT,HTML", which runs the base checks and writes both a text and an HTML report. Adding -Extended pulls in additional information gathering aimed at exploit development and post-exploitation context, while -Audit adds checks relevant to a configuration audit rather than pure privilege escalation. These tiers are a thoughtful separation: a quick triage run, an extensive run, and a comprehensive run are three genuinely different missions, and the README documents each as a distinct use case.
A fourth switch, -Risky, is the most interesting from a defensive perspective. The README is explicit that these checks are likely to trigger active EDR countermeasures because of their behavior. Rather than pretending the tool is invisible, the author acknowledges endpoint telemetry head-on and gives the operator a way to consciously accept or avoid that risk. For blue teams this is valuable intelligence in itself: the existence of a risky-check category tells defenders which classes of enumeration actions their sensors are best positioned to catch, and it explains why a disciplined tester would omit them in environments where stealth matters more than coverage. The -Silent flag, which suppresses terminal output for batch or scheduled-task execution, is the other operationally notable switch.
Reporting is a first-class feature rather than an afterthought. -Report accepts TXT, HTML, CSV, and XML, or the alias ALL to emit everything, with -FilePath overriding the automatically generated filename. The HTML report is self-contained with no external dependencies, requires no internet connection, and supports sorting and filtering in the browser — a genuinely useful property when reviewing hundreds of findings offline in a report-writing phase. The CSV and XML outputs target automated reporting pipelines; the README admits the schema is not yet documented but points out that each check carries an Id value usable as a stable identifier, which is enough for teams building tooling around the output.
The check taxonomy deserves attention. Base checks always execute unless the process is elevated, and they target actual privilege escalation vulnerabilities. Extended checks exist to feed exploit development and post-exploitation reasoning. Audit checks surface configuration-level information meaningful for a hardening review. This layering means the same tool serves both offensive and defensive missions: an auditor running with -Audit is collecting misconfiguration evidence for remediation, not attack paths. That dual utility is worth emphasizing for anyone framing this as purely offensive tooling — a configuration audit on systems you administer is squarely within its intended use.
The README's operational notes reveal the maturity of the project. It addresses PowerShell execution policy head-on, noting that clients default to Restricted and servers to RemoteSigned, and showing how -Scope Process bypass works — while also covering the harder case where policy is enforced via GPO, where a Get-Content ... | Invoke-Expression pattern is suggested instead. It also documents deliberate retro-compatibility with PowerShell version 2, maintained because downgrading to PSv2 is a common way to escape Constrained Language Mode. The author even corrects an earlier claim inline, noting PSv2 is no longer enabled by default and depends on a manually installed .NET 2.0. That level of honest, versioned documentation signals a maintainer who actually tests against current Windows builds.
Integration with Metasploit is covered too, which confirms the intended professional audience. When imported into a Meterpreter session via powershell_import and executed with powershell_execute, the default 15-second Metasploit timeout is insufficient for a full run, so the README walks through raising it with sessions -t 120. This is not deep exploitation guidance — it is plumbing advice for a well-known timeout error — but it illustrates where the tool sits in a real workflow: loaded into an existing foothold during a scoped engagement, not fired blindly at third-party systems.
The build system is more sophisticated than the single-file distribution suggests. Some checks depend on online data, most notably the LOL drivers database from loldrivers.io, but the script is designed to work fully offline by embedding that data at build time. Running Update-LolDriverFile through build\Build.ps1 refreshes the embedded datasets, and Invoke-Build -Name PrivescCheck produces the distributable in .\dist\. Curiously, the build pipeline randomizes variable names per module using a seeded PRNG, with -NoNewSeed available for reproducible builds. That per-build name randomization is a lightweight obfuscation-by-construction approach — worth understanding if you maintain detections around this tool, since static signatures keyed to internal variable names will not survive a rebuild.
Credits are minimal and appropriate: a word list borrowed from CBHue/PyFuscation and the known-vulnerable-driver list from loldrivers.io. The latter dependency places the tool partly in the BYOVD-adjacent detection space, since enumerating vulnerable drivers on a host is reconnaissance for driver-abuse escalation techniques as well as a defensive finding about which drivers should be removed.
For defenders, PrivescCheck is as much a purple-team instrument as an offensive one. Its own documentation tells you what a run looks like: a powershell.exe process launched with -ep bypass, dot-sourcing a large .ps1, spawning file reads and permission queries across the filesystem and registry, and writing report files with predictable extensions. The -Risky tier tells you which behaviors are most likely to trip behavioral detections. Deploying the tool in a lab and observing what your EDR records is a cheap, high-yield detection-engineering exercise. For authorized assessors, it remains one of the most disciplined enumeration scripts in the Windows ecosystem: context-aware, tiered, well-reported, and honest about its own telemetry footprint.
In sum, PrivescCheck earns its place through restrained scope and thoughtful engineering rather than feature sprawl. The user-context model prevents false findings, the check tiers map cleanly onto assessment phases, the reporting formats integrate with both human review and automation, and the documentation anticipates the real friction points of execution policy, language mode, C2 timeouts, and EDR. Used within written authorization on owned or contracted systems, it is a model example of what a professional enumeration tool should look like.
itm4n/PrivescCheck.Educational analysis for authorized security professionals. Use only in controlled, authorized environments.
Related coverage
0 comentários:
Post a Comment
Note: Only a member of this blog may post a comment.