- suppressing chrome decrypt credentials error

This commit is contained in:
makikvues 2021-02-13 17:33:15 +01:00
parent 1ceb041ee5
commit 6a99882f85
2 changed files with 30 additions and 24 deletions

View File

@ -16,7 +16,7 @@ namespace winPEAS.KnownFileCreds.Browsers
{ {
Beaprint.MainPrint($"Showing saved credentials for {Name}"); Beaprint.MainPrint($"Showing saved credentials for {Name}");
var credentials = GetSavedCredentials().ToList(); var credentials = (GetSavedCredentials() ?? new List<CredentialModel>()).ToList();
if (credentials.Count == 0) if (credentials.Count == 0)
{ {

View File

@ -17,10 +17,11 @@ namespace winPEAS.KnownFileCreds.Browsers
public override IEnumerable<CredentialModel> GetSavedCredentials() public override IEnumerable<CredentialModel> GetSavedCredentials()
{ {
var result = new List<CredentialModel>(); var result = new List<CredentialModel>();
var p = Path.Combine(BaseAppDataPath, "Login Data"); var p = Path.Combine(BaseAppDataPath, "Login Data");
var keyPath = Path.Combine(BaseAppDataPath, "..\\Local State"); var keyPath = Path.Combine(BaseAppDataPath, "..\\Local State");
try
{
if (File.Exists(p)) if (File.Exists(p))
{ {
SQLiteDatabase database = new SQLiteDatabase(p); SQLiteDatabase database = new SQLiteDatabase(p);
@ -51,6 +52,11 @@ namespace winPEAS.KnownFileCreds.Browsers
database.CloseDatabase(); database.CloseDatabase();
} }
} }
}
catch (Exception e)
{
return null;
}
return result; return result;
} }