Skip to content

Commit 933316d

Browse files
committed
PingCastle 3.2.0.1
1 parent 27d230f commit 933316d

File tree

3 files changed

+28
-27
lines changed

3 files changed

+28
-27
lines changed

Healthcheck/Rules/HeatlcheckRuleStaleADRegistrationEnabled.cs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ public class HeatlcheckRuleStaleADRegistrationEnabled : RuleBase<HealthcheckData
2323
{
2424
return 0;
2525
}
26-
var gpo = new Dictionary<IGPOReference, string>();
26+
var gpo = new Dictionary<IGPOReference, List<string>>();
2727
foreach (GPPRightAssignment right in healthcheckData.GPPRightAssignment)
2828
{
2929
if (right.Privilege == "SeMachineAccountPrivilege")
3030
{
31-
gpo.Add(right, right.User);
31+
if (!gpo.ContainsKey(right))
32+
gpo[right] = new List<string>();
33+
gpo[right].Add(right.User);
3234
}
3335
}
3436
var o = ApplyGPOPrority2(healthcheckData, gpo);
@@ -37,14 +39,17 @@ public class HeatlcheckRuleStaleADRegistrationEnabled : RuleBase<HealthcheckData
3739
foreach (var v in o)
3840
{
3941
found = true;
40-
if (v.Value == GraphObjectReference.Everyone
41-
|| v.Value == GraphObjectReference.AuthenticatedUsers
42-
|| v.Value == GraphObjectReference.Users
43-
|| v.Value == GraphObjectReference.Anonymous
44-
)
42+
foreach (var user in v.Value)
4543
{
46-
Trace.WriteLine("Found on " + v.Key.GPOName + " with " + v.Value);
47-
return healthcheckData.MachineAccountQuota;
44+
if (user == GraphObjectReference.Everyone
45+
|| user == GraphObjectReference.AuthenticatedUsers
46+
|| user == GraphObjectReference.Users
47+
|| user == GraphObjectReference.Anonymous
48+
)
49+
{
50+
Trace.WriteLine("Found on " + v.Key.GPOName + " with " + v.Value);
51+
return healthcheckData.MachineAccountQuota;
52+
}
4853
}
4954
}
5055

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
// Numéro de build
2929
// Révision
3030
//
31-
[assembly: AssemblyVersion("3.2.0.0")]
32-
[assembly: AssemblyFileVersion("3.2.0.0")]
31+
[assembly: AssemblyVersion("3.2.0.1")]
32+
[assembly: AssemblyFileVersion("3.2.0.1")]

RPC/rpcfirewallchecker.cs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,37 @@ namespace PingCastle.RPC
1111
{
1212
public class RpcFirewallChecker : rpcapi
1313
{
14-
private static byte[] MIDL_ProcFormatStringx86;
15-
16-
private static byte[] MIDL_ProcFormatStringx64;
17-
18-
private static byte[] MIDL_TypeFormatStringx64;
19-
20-
private static byte[] MIDL_TypeFormatStringx86;
21-
14+
2215
int maxOpNum;
2316

2417
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
2518
private RpcFirewallChecker(Guid interfaceId, string pipe, ushort majorVersion, ushort minorVersion, int maxOpNum)
2619
{
20+
byte[] MIDL_ProcFormatString;
21+
byte[] MIDL_TypeFormatString;
22+
2723
this.maxOpNum = maxOpNum;
2824
if (IntPtr.Size == 8)
2925
{
30-
MIDL_ProcFormatStringx64 = new byte[30 * maxOpNum + 1];
26+
MIDL_ProcFormatString = new byte[30 * maxOpNum + 1];
3127
for (byte i = 0; i < maxOpNum; i++)
3228
{
3329
var v = new byte[] { 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, i, 0x00, 0x08, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x0a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
34-
Array.Copy(v, 0, MIDL_ProcFormatStringx64, 30 * i, v.Length);
30+
Array.Copy(v, 0, MIDL_ProcFormatString, 30 * i, v.Length);
3531
}
36-
MIDL_TypeFormatStringx64 = new byte[3];
37-
InitializeStub(interfaceId, MIDL_ProcFormatStringx64, MIDL_TypeFormatStringx64, "\\pipe\\" + pipe, majorVersion, minorVersion);
32+
MIDL_TypeFormatString = new byte[3];
33+
InitializeStub(interfaceId, MIDL_ProcFormatString, MIDL_TypeFormatString, "\\pipe\\" + pipe, majorVersion, minorVersion);
3834
}
3935
else
4036
{
41-
MIDL_ProcFormatStringx86 = new byte[28 * maxOpNum + 1];
37+
MIDL_ProcFormatString = new byte[28 * maxOpNum + 1];
4238
for (byte i = 0; i < maxOpNum; i++)
4339
{
4440
var v = new byte[] { 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, i, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
45-
Array.Copy(v, 0, MIDL_ProcFormatStringx86, 28 * i, v.Length);
41+
Array.Copy(v, 0, MIDL_ProcFormatString, 28 * i, v.Length);
4642
}
47-
MIDL_TypeFormatStringx86 = new byte[3];
48-
InitializeStub(interfaceId, MIDL_ProcFormatStringx86, MIDL_TypeFormatStringx86, "\\pipe\\" + pipe, majorVersion, minorVersion);
43+
MIDL_TypeFormatString = new byte[3];
44+
InitializeStub(interfaceId, MIDL_ProcFormatString, MIDL_TypeFormatString, "\\pipe\\" + pipe, majorVersion, minorVersion);
4945
}
5046
}
5147

0 commit comments

Comments
 (0)