Skip to content

Instantly share code, notes, and snippets.

@mdjx
Last active May 7, 2021 07:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdjx/329d0a87c0f1848be330624836eed42b to your computer and use it in GitHub Desktop.
Save mdjx/329d0a87c0f1848be330624836eed42b to your computer and use it in GitHub Desktop.
"https://mail.yourcompany.com" | % {try {iwr "$_/ecp/DDI/DDIService.svc/GetList?ActivityCorrelationID=X&schema=Antimalware&SecurityToken=Y" -UseBasicParsing} catch {$E=$_.ErrorDetails.Message; if (($E |sls "404.0 - Not Found" -Quiet) -and ($E | sls "Logon User(.*)Anonymous" -Quiet)) {Write-Output "Protected"} elseif (($E |sls "404.0 - Not Found" -Quiet) -and ($E | sls "Logon User" -Quiet)) {Write-Output "Vulnerable"} else {Write-Output "Unknown: Returned data does not contain expected values"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment