Skip to content

Commit d6eacb4

Browse files
committed
Add special rule A-PreWin2000AuthenticatedUsers for the printnightmare vulnerability
1 parent 19a3890 commit d6eacb4

File tree

6 files changed

+61
-3
lines changed

6 files changed

+61
-3
lines changed

Data/HealthcheckData.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,9 @@ public Dictionary<string, GPOInfo> GPOInfoDic
958958
public bool ShouldSerializePreWindows2000NoDefault() { return (int)Level <= (int)PingCastleReportDataExportLevel.Normal; }
959959
public bool PreWindows2000NoDefault { get; set; }
960960

961+
public bool ShouldSerializePreWindows2000AuthenticatedUsers() { return (int)Level <= (int)PingCastleReportDataExportLevel.Normal; }
962+
public bool PreWindows2000AuthenticatedUsers { get; set; }
963+
961964
public bool ShouldSerializeDsHeuristicsAnonymousAccess() { return (int)Level <= (int)PingCastleReportDataExportLevel.Normal; }
962965
public bool DsHeuristicsAnonymousAccess { get; set; }
963966

Healthcheck/HealthcheckAnalyzer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3509,6 +3509,10 @@ private void GenerateAnomalies(ADDomainInfo domainInfo, ADWebService adws)
35093509
healthcheckData.PreWindows2000AnonymousAccess = true;
35103510
continue;
35113511
}
3512+
if (member.Contains("S-1-5-11"))
3513+
{
3514+
healthcheckData.PreWindows2000AuthenticatedUsers = true;
3515+
}
35123516
if (!member.StartsWith("CN=S-"))
35133517
{
35143518
healthcheckData.PreWindows2000NoDefault = true;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// Copyright (c) Ping Castle. All rights reserved.
3+
// https://www.pingcastle.com
4+
//
5+
// Licensed under the Non-Profit OSL. See LICENSE file in the project root for full license information.
6+
//
7+
using PingCastle.Rules;
8+
9+
namespace PingCastle.Healthcheck.Rules
10+
{
11+
[RuleModel("A-PreWin2000AuthenticatedUsers", RiskRuleCategory.Anomalies, RiskModelCategory.Reconnaissance)]
12+
[RuleComputation(RuleComputationType.TriggerOnPresence, 0)]
13+
//[RuleBSI("M 2.412")]
14+
[RuleMaturityLevel(5)]
15+
public class HeatlcheckRuleAnomalyPreWin2000AuthenticatedUsers : RuleBase<HealthcheckData>
16+
{
17+
protected override int? AnalyzeDataNew(HealthcheckData healthcheckData)
18+
{
19+
if (healthcheckData.PreWindows2000AuthenticatedUsers)
20+
{
21+
return 1;
22+
}
23+
return 0;
24+
}
25+
}
26+
}

Healthcheck/Rules/RuleDescription.resx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3778,4 +3778,28 @@ If the script is detected, Windows 7 is considered as supported and this rule is
37783778
<data name="S_OS_Win7_Title" xml:space="preserve">
37793779
<value>Obsolete OS (Windows 7)</value>
37803780
</data>
3781+
<data name="A_PreWin2000AuthenticatedUsers_Description" xml:space="preserve">
3782+
<value>The purpose is check if the "Pre-Windows 2000 Compatible Access" group contains authenticated users</value>
3783+
</data>
3784+
<data name="A_PreWin2000AuthenticatedUsers_Documentation" xml:space="preserve">
3785+
<value>https://msdn.microsoft.com/en-us/library/cc223672.aspx</value>
3786+
</data>
3787+
<data name="A_PreWin2000AuthenticatedUsers_Rationale" xml:space="preserve">
3788+
<value>The PreWin2000 compatible group contains "authenticated users"</value>
3789+
</data>
3790+
<data name="A_PreWin2000AuthenticatedUsers_Solution" xml:space="preserve">
3791+
<value>Remove "authenticated users" from the PreWin2000 group.</value>
3792+
</data>
3793+
<data name="A_PreWin2000AuthenticatedUsers_TechnicalExplanation" xml:space="preserve">
3794+
<value>The pre-Windows 2000 compatible access group grants access to some RPC calls.
3795+
Its default and secure value is the "Authenticated Users" group which allows users to perform group look up using legacy protocols.
3796+
3797+
If this group contains "Authenticated Users", it increases the impact on the exploitation vulnerability on legacy protocols such as the printer spooler.
3798+
Indeed, in the #PrintNightmare attack, it enables a patch bypass on domain controllers because the property Elevated Token is on when establishing a session to the DC.
3799+
Removing the group can have side impacts and as a consequence, this is reported here as a special hardening measure.
3800+
</value>
3801+
</data>
3802+
<data name="A_PreWin2000AuthenticatedUsers_Title" xml:space="preserve">
3803+
<value>Check that the "Pre-Windows 2000 Compatible Access" group does not contain "Authenticated Users"</value>
3804+
</data>
37813805
</root>

PingCastle.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
<Compile Include="Data\HealthCheckBUEntityData.cs" />
124124
<Compile Include="Data\CompromiseGraphData.cs" />
125125
<Compile Include="Healthcheck\HoneyPotSettings.cs" />
126+
<Compile Include="Healthcheck\Rules\HeatlcheckRuleAnomalyPreWin2000AuthenticatedUsers.cs" />
126127
<Compile Include="Healthcheck\Rules\HeatlcheckRuleStaledObsoleteWin7.cs" />
127128
<Compile Include="Healthcheck\Rules\HeatlcheckRuleTrustAzureADSSO.cs" />
128129
<Compile Include="Healthcheck\Rules\HeatlcheckRuleAnomalyUnixPassword.cs" />

Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[assembly: AssemblyConfiguration("")]
1010
[assembly: AssemblyCompany("Ping Castle")]
1111
[assembly: AssemblyProduct("Ping Castle")]
12-
[assembly: AssemblyCopyright("Copyright © 2019 Ping Castle")]
12+
[assembly: AssemblyCopyright("Copyright © 2015-2021 Ping Castle")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

@@ -28,5 +28,5 @@
2828
// Numéro de build
2929
// Révision
3030
//
31-
[assembly: AssemblyVersion("2.9.2.0")]
32-
[assembly: AssemblyFileVersion("2.9.2.0")]
31+
[assembly: AssemblyVersion("2.9.2.1")]
32+
[assembly: AssemblyFileVersion("2.9.2.1")]

0 commit comments

Comments
 (0)