Merge pull request #380 from makikvues/fix-tests-and-logo

Fixed logo, removed  long-running checks from tests,  create search lists only if necessary
This commit is contained in:
Carlos Polop 2023-08-05 18:02:31 +02:00 committed by GitHub
commit ae37d8f24f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 9 deletions

View File

@ -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);
}

View File

@ -68,6 +68,8 @@ namespace winPEAS.Checks
{
//Check parameters
bool isAllChecks = true;
bool isFileSearchEnabled = false;
var searchEnabledChecks = new HashSet<string>() { "fileanalysis, filesinfo" };
bool wait = false;
FileStream fileStream = null;
StreamWriter fileWriter = null;
@ -202,8 +204,18 @@ namespace winPEAS.Checks
{
_systemCheckSelectedKeysHashSet.Add(argToLower);
isAllChecks = false;
if (searchEnabledChecks.Contains(argToLower))
{
isFileSearchEnabled = true;
}
}
}
if (isAllChecks)
{
isFileSearchEnabled = true;
}
try
{
@ -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,9 +407,12 @@ namespace winPEAS.Checks
}
//create the file lists
// only if we are running all checks or systeminfo / fileanalysis
Beaprint.GrayPrint(" - Creating files/directories list for search...");
if (isFileSearchEnabled)
{
try
{
Beaprint.GrayPrint(" - Creating files/directories list for search...");
SearchHelper.CreateSearchDirectoriesList();
}
catch (Exception ex)
@ -405,6 +420,11 @@ namespace winPEAS.Checks
Beaprint.GrayPrint("Error while creating directory list: " + ex);
}
}
else
{
Beaprint.GrayPrint(" [skipped, file search is disabled]");
}
}
private static void CheckRegANSI()
{