Skip to content

Instantly share code, notes, and snippets.

@BanterBoy
Created June 2, 2018 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BanterBoy/601bee776825823ca6c7bf3dcf3de97f to your computer and use it in GitHub Desktop.
Save BanterBoy/601bee776825823ca6c7bf3dcf3de97f to your computer and use it in GitHub Desktop.
Quick script to check an Email address against https://haveibeenpwned.com/api also creates object $Pwned which can then be interrogated further.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$PwnedSite = "https://haveibeenpwned.com/api/v2/breachedaccount/"
$PwnedAddress = Read-Host "Email Address"
Invoke-RestMethod -Uri ($PwnedSite + $PwnedAddress) -OutVariable Pwned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment