- fixed logo

- updated tests, long-running checks are removed
- create search lists only if necessary
This commit is contained in:
makikvues 2023-08-03 19:21:22 +02:00
parent 667bb5220d
commit 78d187db52
3 changed files with 29 additions and 9 deletions

View File

@ -12,7 +12,7 @@ namespace winPEAS.Tests
try try
{ {
string[] args = new string[] { string[] args = new string[] {
"systeminfo", "servicesinfo", "processinfo", "applicationsinfo", "browserinfo", "debug" "systeminfo", "userinfo", "servicesinfo", "browserinfo", "eventsinfo", "debug"
}; };
Program.Main(args); Program.Main(args);
} }

View File

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