Created
April 26, 2019 05:08
-
-
Save ArtisanByteCrafter/7956a0a76656beb1b58920c64a356d39 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Function Get-OwnedPW { | |
param( | |
[string] $test | |
) | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
$a, $b = (Get-FileHash -A 'SHA1' -I ([IO.MemoryStream]::new([Text.Encoding]::UTF8.GetBytes($test)))).Hash -split '(?<=^.{5})' | |
(((Invoke-RestMethod "https://api.pwnedpasswords.com/range/$a" -UseB) -split '\r\n' -like "$b*") -split ':')[-1] | | |
Foreach-Object { | |
Write-Host -ForegroundColor Green "This has been publically cracked $_ times according to api.pwnedpasswords.com" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment