Skip to content

Commit

Permalink
PingCastle 3.1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vletoux committed Aug 28, 2023
1 parent de404d6 commit 0276590
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Exports/ExportComputers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public override void Export(string filename)
data.Add(string.Empty);
data.Add(string.Empty);
}
if (lapsAnalyzer.LegacyLAPSIntId > 0 && x.ReplPropertyMetaData != null && x.ReplPropertyMetaData.ContainsKey(lapsAnalyzer.LegacyLAPSIntId))
if (lapsAnalyzer.LegacyLAPSIntId != 0 && x.ReplPropertyMetaData != null && x.ReplPropertyMetaData.ContainsKey(lapsAnalyzer.LegacyLAPSIntId))
{
var dd = x.ReplPropertyMetaData[lapsAnalyzer.LegacyLAPSIntId];
data.Add(dd.LastOriginatingChange.ToString("u"));
Expand All @@ -109,7 +109,7 @@ public override void Export(string filename)
{
data.Add(string.Empty);
}
if (lapsAnalyzer.MsLAPSIntId > 0 && x.ReplPropertyMetaData != null && x.ReplPropertyMetaData.ContainsKey(lapsAnalyzer.MsLAPSIntId))
if (lapsAnalyzer.MsLAPSIntId != 0 && x.ReplPropertyMetaData != null && x.ReplPropertyMetaData.ContainsKey(lapsAnalyzer.MsLAPSIntId))
{
var dd = x.ReplPropertyMetaData[lapsAnalyzer.MsLAPSIntId];
data.Add(dd.LastOriginatingChange.ToString("u"));
Expand Down
16 changes: 8 additions & 8 deletions Healthcheck/HealthcheckAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ private void GenerateComputerData(ADDomainInfo domainInfo, ADWebService adws)
}
}
}
if (x.ReplPropertyMetaData != null && LAPSAnalyzer.LegacyLAPSIntId > 0 && x.ReplPropertyMetaData.ContainsKey(LAPSAnalyzer.LegacyLAPSIntId))
if (x.ReplPropertyMetaData != null && LAPSAnalyzer.LegacyLAPSIntId != 0 && x.ReplPropertyMetaData.ContainsKey(LAPSAnalyzer.LegacyLAPSIntId))
{
proxy.AddWithoutDetail("LAPS");
var d = x.ReplPropertyMetaData[LAPSAnalyzer.LegacyLAPSIntId];
Expand All @@ -938,7 +938,7 @@ private void GenerateComputerData(ADDomainInfo domainInfo, ADWebService adws)
lapsDistribution[i] = 1;
}
}
if (x.ReplPropertyMetaData != null && LAPSAnalyzer.MsLAPSIntId > 0 && x.ReplPropertyMetaData.ContainsKey(LAPSAnalyzer.MsLAPSIntId))
if (x.ReplPropertyMetaData != null && LAPSAnalyzer.MsLAPSIntId != 0 && x.ReplPropertyMetaData.ContainsKey(LAPSAnalyzer.MsLAPSIntId))
{
proxy.AddWithoutDetail("LAPSNew");
var d = x.ReplPropertyMetaData[LAPSAnalyzer.MsLAPSIntId];
Expand Down Expand Up @@ -2607,7 +2607,7 @@ void ThreadGPOAnalysis(int ThreadId, ADWebService adws, string directoryFullName
if (adws.FileConnection.FileExists(path))
{
step = "extract GPP local group assignment";
ExtractLocalGroupAssignment(adws, path, GPO, "Unknown [" + shortName + "]");
ExtractLocalGroupAssignment(adws, path, GPO);
}
path = directoryFullName + @"\Machine\Microsoft\Windows nt\SecEdit\GptTmpl.inf";
if (adws.FileConnection.FileExists(path))
Expand Down Expand Up @@ -2680,14 +2680,14 @@ void ThreadGPOAnalysis(int ThreadId, ADWebService adws, string directoryFullName
}
}

private void ExtractLocalGroupAssignment(ADWebService adws, string path, GPO GPO, string p)
private void ExtractLocalGroupAssignment(ADWebService adws, string path, GPO GPO)
{
XmlDocument doc = new XmlDocument();
doc.Load(path);
XmlNodeList nodeList = doc.SelectNodes(@"//Group");
foreach (XmlNode node in nodeList)
{
XmlNode actionNode = node.SelectSingleNode(@"//Properties/@action");
XmlNode actionNode = node.SelectSingleNode(@"Properties/@action");
if (actionNode != null)
{
switch (actionNode.Value.ToUpperInvariant())
Expand All @@ -2703,7 +2703,7 @@ private void ExtractLocalGroupAssignment(ADWebService adws, string path, GPO GPO
var groupNameNode = node.SelectSingleNode("@name");
if (groupNameNode == null)
continue;
foreach (XmlNode userNameNode in node.SelectNodes(@"//Member[@action=""ADD""]"))
foreach (XmlNode userNameNode in node.SelectNodes(@"Properties/Members/Member[@action=""ADD""]"))
{
var sidnode = userNameNode.SelectSingleNode("@sid");
if (sidnode == null)
Expand Down Expand Up @@ -4552,9 +4552,9 @@ private LAPSAnalyzer CheckLAPSInstalled(ADDomainInfo domainInfo, ADWebService ad
var f = false;
// check if there is a LAPS attribute (looked into metadata because hidden if the current user has not right to read it)
if (
(lapsAnalyzer.LegacyLAPSIntId > 0 && x.ReplPropertyMetaData.ContainsKey(lapsAnalyzer.LegacyLAPSIntId))
(lapsAnalyzer.LegacyLAPSIntId != 0 && x.ReplPropertyMetaData.ContainsKey(lapsAnalyzer.LegacyLAPSIntId))
||
(lapsAnalyzer.MsLAPSIntId > 0 && x.ReplPropertyMetaData.ContainsKey(lapsAnalyzer.MsLAPSIntId))
(lapsAnalyzer.MsLAPSIntId != 0 && x.ReplPropertyMetaData.ContainsKey(lapsAnalyzer.MsLAPSIntId))
)
{
if (x.NTSecurityDescriptor != null)
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
// Numéro de build
// Révision
//
[assembly: AssemblyVersion("3.1.0.0")]
[assembly: AssemblyFileVersion("3.1.0.0")]
[assembly: AssemblyVersion("3.1.0.1")]
[assembly: AssemblyFileVersion("3.1.0.1")]
4 changes: 2 additions & 2 deletions Scanners/LAPSBitLocker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ public void Export(string filename)
LastLogonTimestamp = x.LastLogonTimestamp,
OperatingSystem = x.OperatingSystem,
};
if (lapsAnalyzer.LegacyLAPSIntId > 0 && x.ReplPropertyMetaData.ContainsKey(lapsAnalyzer.LegacyLAPSIntId))
if (lapsAnalyzer.LegacyLAPSIntId != 0 && x.ReplPropertyMetaData.ContainsKey(lapsAnalyzer.LegacyLAPSIntId))
{
computer.HasLegacyLAPS = true;
computer.LegacyLAPSLastChange = x.ReplPropertyMetaData[lapsAnalyzer.LegacyLAPSIntId].LastOriginatingChange;
}
if (lapsAnalyzer.MsLAPSIntId > 0 && x.ReplPropertyMetaData.ContainsKey(lapsAnalyzer.MsLAPSIntId))
if (lapsAnalyzer.MsLAPSIntId != 0 && x.ReplPropertyMetaData.ContainsKey(lapsAnalyzer.MsLAPSIntId))
{
computer.HasMsLAPS = true;
computer.MsLAPSLastChange = x.ReplPropertyMetaData[lapsAnalyzer.MsLAPSIntId].LastOriginatingChange;
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
3.1.0.1
* fix local membership if many settings are defined
* fix LAPS collection (signed / unsigned bug)

3.1.0.0
* fix a bug for machineaccountquote when GPO has been rewritten to remove all users
* fix a regression introduced in previous version in P-TrustedCredManAccessPrivilege
Expand Down

0 comments on commit 0276590

Please sign in to comment.