diff --git a/winPEAS/winPEASexe/Tests/SmokeTests.cs b/winPEAS/winPEASexe/Tests/SmokeTests.cs index fa71d04..49525a3 100644 --- a/winPEAS/winPEASexe/Tests/SmokeTests.cs +++ b/winPEAS/winPEASexe/Tests/SmokeTests.cs @@ -12,7 +12,7 @@ namespace winPEAS.Tests try { string[] args = new string[] { - "systeminfo", "servicesinfo", "processinfo", "applicationsinfo", "browserinfo", "debug" + "systeminfo", "userinfo", "servicesinfo", "browserinfo", "eventsinfo", "debug" }; Program.Main(args); } diff --git a/winPEAS/winPEASexe/winPEAS/Checks/Checks.cs b/winPEAS/winPEASexe/winPEAS/Checks/Checks.cs index cd5e6f3..7ee5bc8 100644 --- a/winPEAS/winPEASexe/winPEAS/Checks/Checks.cs +++ b/winPEAS/winPEASexe/winPEAS/Checks/Checks.cs @@ -68,6 +68,8 @@ namespace winPEAS.Checks { //Check parameters bool isAllChecks = true; + bool isFileSearchEnabled = false; + var searchEnabledChecks = new HashSet() { "fileanalysis, filesinfo" }; bool wait = false; FileStream fileStream = null; StreamWriter fileWriter = null; @@ -202,9 +204,19 @@ namespace winPEAS.Checks { _systemCheckSelectedKeysHashSet.Add(argToLower); isAllChecks = false; + + if (searchEnabledChecks.Contains(argToLower)) + { + isFileSearchEnabled = true; + } } } + if (isAllChecks) + { + isFileSearchEnabled = true; + } + try { CheckRunner.Run(() => @@ -223,7 +235,7 @@ namespace winPEAS.Checks Beaprint.PrintInit(); - CheckRunner.Run(CreateDynamicLists, IsDebug); + CheckRunner.Run(() => CreateDynamicLists(isFileSearchEnabled), IsDebug); RunChecks(isAllChecks, wait); @@ -264,7 +276,7 @@ namespace winPEAS.Checks } } - private static void CreateDynamicLists() + private static void CreateDynamicLists(bool isFileSearchEnabled) { Beaprint.GrayPrint(" Creating Dynamic lists, this could take a while, please wait..."); @@ -395,14 +407,22 @@ namespace winPEAS.Checks } //create the file lists - try + // only if we are running all checks or systeminfo / fileanalysis + Beaprint.GrayPrint(" - Creating files/directories list for search..."); + if (isFileSearchEnabled) { - Beaprint.GrayPrint(" - Creating files/directories list for search..."); - SearchHelper.CreateSearchDirectoriesList(); + try + { + SearchHelper.CreateSearchDirectoriesList(); + } + catch (Exception ex) + { + Beaprint.GrayPrint("Error while creating directory list: " + ex); + } } - catch (Exception ex) + else { - Beaprint.GrayPrint("Error while creating directory list: " + ex); + Beaprint.GrayPrint(" [skipped, file search is disabled]"); } } diff --git a/winPEAS/winPEASexe/winPEAS/Helpers/Beaprint.cs b/winPEAS/winPEASexe/winPEAS/Helpers/Beaprint.cs index 1ec83d0..095d5a5 100644 --- a/winPEAS/winPEASexe/winPEAS/Helpers/Beaprint.cs +++ b/winPEAS/winPEASexe/winPEAS/Helpers/Beaprint.cs @@ -82,7 +82,7 @@ namespace winPEAS.Helpers | {1}Do you like PEASS?{0} | |---------------------------------------------------------------------------------| | {3}Get the latest version{0} : {2}https://github.com/sponsors/carlospolop{0} | - | {3}Follow on Twitter{0} : {2}@hacktricks_live{0} | + | {3}Follow on Twitter{0} : {2}@hacktricks_live{0} | | {3}Respect on HTB{0} : {2}SirBroccoli {0} | |---------------------------------------------------------------------------------| | {1}Thank you!{0} |