From 340256b3b395d862fb659e4df5bf994a32c1321e Mon Sep 17 00:00:00 2001 From: Signum21 Date: Tue, 28 Nov 2023 00:38:13 +0100 Subject: [PATCH] Better error handling in FileAnalysis The previous specific check doesn't handle the following exception, causing it to be catched by the last try/catch block. Error looking for regexes inside files: System.AggregateException: One or more errors occurred. ---> System.UnauthorizedAccessException: Access to the path '' is denied. --- winPEAS/winPEASexe/winPEAS/Checks/FileAnalysis.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winPEAS/winPEASexe/winPEAS/Checks/FileAnalysis.cs b/winPEAS/winPEASexe/winPEAS/Checks/FileAnalysis.cs index 05335e098..0aa85b2d5 100644 --- a/winPEAS/winPEASexe/winPEAS/Checks/FileAnalysis.cs +++ b/winPEAS/winPEASexe/winPEAS/Checks/FileAnalysis.cs @@ -444,7 +444,7 @@ private static void PrintYAMLRegexesSearchFiles() foundRegexes[regex_obj.name][regex.name] = fileResults; } } - catch (System.IO.IOException) + catch (Exception ex) { // Cannot read the file }