Skip to content

Instantly share code, notes, and snippets.

@jstangroome
Created October 11, 2010 22:32
Show Gist options
  • Save jstangroome/621345 to your computer and use it in GitHub Desktop.
Save jstangroome/621345 to your computer and use it in GitHub Desktop.
PowerShell script to test if ASP.NET padding security patch is applied
Set-StrictMode -Version Latest
[Reflection.Assembly]::Load('System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') | Out-Null
[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'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment