-
-
Save tathamoddie/621348 to your computer and use it in GitHub Desktop.
PowerShell script to test if ASP.NET padding security patch is applied
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-StrictMode -Version Latest | |
[Reflection.Assembly]::Load('System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') | Out-Null | |
$PatchedMethod = [System.Web.Configuration.MachineKeySection].GetMethods('NonPublic, Public, Static') | | |
Where-Object { | |
$LastParameter = $_.GetParameters() | Select-Object -Last 1 | |
$_.Name -eq 'EncryptOrDecryptData' -and | |
$LastParameter -ne $null -and | |
$LastParameter.ParameterType -eq [bool] -and | |
$LastParameter.Name -eq 'signData' | |
} | |
if ($PatchedMethod) { | |
"POET patch is applied." | |
} else { | |
Write-Warning "POET patch is NOT applied." | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment