Created
December 7, 2018 15:37
-
-
Save keyboardcrunch/a635704e6afd990b19b2ef9ba15bdccd to your computer and use it in GitHub Desktop.
enumerate data from certificates overridden in firefox
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
$SkipFolders = ("Public", "Default") | |
$UserFolders = Get-ChildItem -Path "C:\Users\" -Exclude $SkipFolders | |
$CertData = @() | |
ForEach ($User in $UserFolders) { | |
$override = Get-ChildItem -Path "$($User)\AppData\Roaming\Mozilla\Firefox\Profiles" -Recurse -Filter cert_override.txt -Force -ErrorAction SilentlyContinue | |
Foreach ($ofile in $override) { | |
$Certs = Get-Content $ofile.FullName | Select-Object -skip 2 | |
Foreach ($line in $Certs) { | |
# # https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Cert_override.txt | |
$data = $line -split '\s+' # split line by whitespace | |
$CertLine = [PSCustomObject] @{ | |
Host = $data[0] | |
HashAlgo = $data[1] | |
Serial = $data[2] | |
OverrideType = $data[3] | |
CertData = $data[4] | |
} | |
$CertData += $CertLine | |
} | |
} | |
} | |
Return $CertData |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment