1
mirror of https://github.com/carlospolop/PEASS-ng synced 2024-11-24 01:26:22 +01:00

- added ISSUE_TEMPLATE.md

- added null reference checks
This commit is contained in:
makikvues 2021-08-27 21:19:16 +02:00
parent 24884a1d7e
commit dbfd0be62e
6 changed files with 48 additions and 7 deletions

23
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,23 @@
#### Issue description
#### Steps to reproduce the issue
1.
2.
3.
#### clean / obfuscated winpeas?
#### AV / Threat protection used
#### Windows version / build
#### Failing Winpeas check
#### Additional details / screenshot

View File

@ -139,7 +139,7 @@ namespace winPEAS.Checks
// get our properties
// ref - https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nn-wuapi-iupdatehistoryentry
var title = searcherObj.GetType().InvokeMember("Title", BindingFlags.GetProperty, null, item, new object[] { }).ToString();
var title = searcherObj.GetType().InvokeMember("Title", BindingFlags.GetProperty, null, item, new object[] { })?.ToString() ?? string.Empty;
var date = searcherObj.GetType().InvokeMember("Date", BindingFlags.GetProperty, null, item, new object[] { });
var description = searcherObj.GetType().InvokeMember("Description", BindingFlags.GetProperty, null, item, new object[] { });
var clientApplicationID = searcherObj.GetType().InvokeMember("ClientApplicationID", BindingFlags.GetProperty, null, item, new object[] { });

View File

@ -80,12 +80,15 @@ namespace winPEAS.Helpers.AppLocker
Beaprint.NoColorPrint($" AppLockerPolicy version: {appLockerSettings.Version}\n listing rules:\n\n");
foreach (var rule in appLockerSettings.RuleCollection)
if (appLockerSettings.RuleCollection != null)
{
PrintFileHashRules(rule);
PrintFilePathRules(rule);
PrintFilePublisherRules(rule);
}
foreach (var rule in appLockerSettings.RuleCollection)
{
PrintFileHashRules(rule);
PrintFilePathRules(rule);
PrintFilePublisherRules(rule);
}
}
}
catch (COMException)
{

View File

@ -143,6 +143,12 @@ namespace winPEAS.Helpers.Registry
{
myKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(path);
}
if (myKey == null)
{
return new string[0];
}
String[] subkeyNames = myKey.GetSubKeyNames();
return myKey.GetSubKeyNames();
}

View File

@ -92,6 +92,12 @@ namespace winPEAS.Info.SystemInfo.SysMon
try
{
var key = registryKey.OpenSubKey(paramsKey);
if (key == null)
{
return null;
}
byte[] result = (byte[])key.GetValue(val);
return result;

View File

@ -90,7 +90,10 @@ namespace winPEAS.Wifi.NativeWifiApi
~WlanClient()
{
WlanApi.WlanCloseHandle(clientHandle, IntPtr.Zero);
if (clientHandle != IntPtr.Zero)
{
WlanApi.WlanCloseHandle(clientHandle, IntPtr.Zero);
}
}
/// <summary>