Skip to content

Assert WDACConfigIntegrity

Violet edited this page Dec 28, 2023 · 15 revisions

Assert-WDACConfigIntegrity available parameters

Assert-WDACConfigIntegrity [-SaveLocally] [-Path <FileInfo>] [-SkipVersionCheck] [<CommonParameters>]

This cmdlet scans all the relevant files in the WDACConfig module's folder and its subfolders, calculates their SHA2-512 hashes using the Get-FileHash cmdlet.

Then it downloads the cloud CSV file from the GitHub repository and compares the hashes of the local files with the ones in the cloud.

By doing so, you can ascertain that the files in your local WDACConfig folder are identical to the ones in the cloud and devoid of any interference.

If there is any indication of tampering, the outcomes will be displayed on the console.


3 Optional Parameters

  • -SaveLocally: This parameter is used to generate hashes of the final modules files prior to publishing them to the GitHub. This parameter shouldn't be used.

  • -Path: Can define a different path for the Hashes.csv file. This parameter shouldn't be used.

  • -SkipVersionCheck: Skips the check for new module version.


The WDACConfig module comprises of .ps1 and .psm1 files that bear the cryptographic signature of my local certificate authority's (CA) certificate. The module incorporates mechanisms to automatically ascertain the integrity of the module files and prevent any unauthorized modifications. The module manifest, .psd1 file, on the other hand, lacks a signature due to the installation error that arises from the PowerShell gallery when it is signed with a self-signed certificate.

You can also obtain the Root CA certificate from this GitHub repository and install it in the Current User's Trust Root Certification Authorities store, which does not necessitate administrator privileges. You can accomplish this in Windows Sandbox or a Hyper-V VM (Virtual Machine). Subsequently, you can utilize the Get-AuthenticodeSignature cmdlet to ascertain the cryptographic signature and authenticity of the module files.










C#


Clone this wiki locally