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 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,9 +204,19 @@ 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
{ {
CheckRunner.Run(() => CheckRunner.Run(() =>
@ -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,14 +407,22 @@ namespace winPEAS.Checks
} }
//create the file lists //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..."); try
SearchHelper.CreateSearchDirectoriesList(); {
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]");
} }
} }

View File

@ -82,7 +82,7 @@ namespace winPEAS.Helpers
| {1}Do you like PEASS?{0} | | {1}Do you like PEASS?{0} |
|---------------------------------------------------------------------------------| |---------------------------------------------------------------------------------|
| {3}Get the latest version{0} : {2}https://github.com/sponsors/carlospolop{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} | | {3}Respect on HTB{0} : {2}SirBroccoli {0} |
|---------------------------------------------------------------------------------| |---------------------------------------------------------------------------------|
| {1}Thank you!{0} | | {1}Thank you!{0} |