Hi Joe,
as I do not use the netcease script anymore, because it is too old and the current windows security settings are more secure this should be mentioned or the finding needs to be removed. Otherwise using the netcease script will reduce security. The link to the Netcease script should be removed and/or the finding needs an updated text.
Finding/RiskID: A-NoNetSessionHardening
So I am sharing my notes with you wich I quickly translated from german.
New operatingsystems already have better security settings as the NetCease script would apply.
If you would anyways like to apply a hardening measurement for this, then analyzing the current permissions and configuring it with GPP or a custom ADM(X)-File could be a more administrative way. Also Powershell to modify a GPOs Administrative Templates without an ADM(X)-file.
Just for example here the values that could/would be set:
# NetCease script expected default
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\DefaultSecurity' -Name SrvsvcSessionInfo -Value (
1,0,4,128,120,0,0,0,132,0,0,0,
0,0,0,0,20,0,0,0,2,0,100,0,
4,0,0,0,0,0,24,0,19,0,15,0,
1,2,0,0,0,0,0,5,32,0,0,0,
32,2,0,0,0,0,24,0,19,0,15,0,
1,2,0,0,0,0,0,5,32,0,0,0,
37,2,0,0,0,0,24,0,19,0,15,0,
1,2,0,0,0,0,0,5,32,0,0,0,
35,2,0,0,0,0,20,0,1,0,0,0,
1,1,0,0,0,0,0,5,11,0,0,0,
1,1,0,0,0,0,0,5,18,0,0,0,
1,1,0,0,0,0,0,5,18,0,0,0 -as [byte[]] )
# NetCease script expected secure configuration
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\DefaultSecurity' -Name SrvsvcSessionInfo -Value (
1,0,4,128,20,0,0,0,32,0,0,0,
0,0,0,0,44,0,0,0,1,1,0,0,
0,0,0,5,18,0,0,0,1,1,0,0,
0,0,0,5,18,0,0,0,2,0,140,0,
6,0,0,0,0,0,20,0,255,1,31,0,
1,1,0,0,0,0,0,5,3,0,0,0,
0,0,20,0,255,1,31,0,1,1,0,0,
0,0,0,5,4,0,0,0,0,0,20,0,
255,1,31,0,1,1,0,0,0,0,0,5,
6,0,0,0,0,0,24,0,19,0,15,0,
1,2,0,0,0,0,0,5,32,0,0,0,
32,2,0,0,0,0,24,0,19,0,15,0,
1,2,0,0,0,0,0,5,32,0,0,0,
35,2,0,0,0,0,24,0,19,0,15,0,
1,2,0,0,0,0,0,5,32,0,0,0,
37,2,0,0 -as [byte[]] )
# New Version of security settings - starting with Windows 10/11, Server 2022 Default at a certain (very old) update
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\DefaultSecurity' -Name SrvsvcSessionInfo -Value (
1,0,4,128,160,0,0,0,172,0,0,0,
0,0,0,0,20,0,0,0,2,0,140,0,
6,0,0,0,0,0,24,0,19,0,15,0,
1,2,0,0,0,0,0,5,32,0,0,0,
32,2,0,0,0,0,24,0,19,0,15,0,
1,2,0,0,0,0,0,5,32,0,0,0,
37,2,0,0,0,0,24,0,19,0,15,0,
1,2,0,0,0,0,0,5,32,0,0,0,
35,2,0,0,0,0,20,0,1,0,0,0,
1,1,0,0,0,0,0,5,4,0,0,0,
0,0,20,0,1,0,0,0,1,1,0,0,
0,0,0,5,6,0,0,0,0,0,20,0,
1,0,0,0,1,1,0,0,0,0,0,5,
3,0,0,0,1,1,0,0,0,0,0,5,
18,0,0,0,1,1,0,0,0,0,0,5,
18,0,0,0 -as [byte[]] )
# if someone prefers GPP:
New-GPO -Name “NetSessionEnumeration”
Set-GPPrefRegistryValue -Name “NetSessionEnumeration” -Context Computer -Key “HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\DefaultSecurity” -ValueName “SrvsvcSessionInfo” -Value (
1,0,4,128,160,0,0,0,172,0,0,0,
0,0,0,0,20,0,0,0,2,0,140,0,
6,0,0,0,0,0,24,0,19,0,15,0,
1,2,0,0,0,0,0,5,32,0,0,0,
32,2,0,0,0,0,24,0,19,0,15,0,
1,2,0,0,0,0,0,5,32,0,0,0,
37,2,0,0,0,0,24,0,19,0,15,0,
1,2,0,0,0,0,0,5,32,0,0,0,
35,2,0,0,0,0,20,0,1,0,0,0,
1,1,0,0,0,0,0,5,4,0,0,0,
0,0,20,0,1,0,0,0,1,1,0,0,
0,0,0,5,6,0,0,0,0,0,20,0,
1,0,0,0,1,1,0,0,0,0,0,5,
3,0,0,0,1,1,0,0,0,0,0,5,
18,0,0,0,1,1,0,0,0,0,0,5,
18,0,0,0 -as [byte] ) -Type Binary -Action Update
New-GPLink -Name “NetSessionEnumeration” -Target “DC=example,DC=com”
gpupdate
When registry value gets applied, a restart of LANMANSERVER is required:
Restart-Service -Name LanmanServer -Force -Verbose
Default for new OS:
Get-NetSessionEnumPermission | ft
TranslatedSID BinaryLength AceQualifier IsCallback OpaqueLength AccessMask SecurityIdentifier AceType AceFlags IsInherited
------------- ------------ ------------ ---------- ------------ ---------- ------------------ ------- -------- -----------
NT AUTHORITY\BATCH 20 AccessAllowed False 0 1 S-1-5-3 AccessAllowed None False
NT AUTHORITY\INTERACTIVE 20 AccessAllowed False 0 1 S-1-5-4 AccessAllowed None False
NT AUTHORITY\SERVICE 20 AccessAllowed False 0 1 S-1-5-6 AccessAllowed None False
BUILTIN\Administrators 24 AccessAllowed False 0 983059 S-1-5-32-544 AccessAllowed None False
24 AccessAllowed False 0 983059 S-1-5-32-547 AccessAllowed None False
BUILTIN\Server Operators 24 AccessAllowed False 0 983059 S-1-5-32-549 AccessAllowed None False
Default for older OS:
Get-NetSessionEnumPermission | ft
TranslatedSID BinaryLength AceQualifier IsCallback OpaqueLength AccessMask SecurityIdentifier AceType AceFlags IsInherited
------------- ------------ ------------ ---------- ------------ ---------- ------------------ ------- -------- -----------
NT-AUTORITÄT\Authentifizierte Benutzer 20 AccessAllowed False 0 1 S-1-5-11 AccessAllowed None False
VORDEFINIERT\Administratoren 24 AccessAllowed False 0 983059 S-1-5-32-544 AccessAllowed None False
24 AccessAllowed False 0 983059 S-1-5-32-547 AccessAllowed None False
VORDEFINIERT\Server-Operatoren 24 AccessAllowed False 0 983059 S-1-5-32-549 AccessAllowed None False
Wrong/Old NetCease Script:
Get-NetSessionEnumPermission | ft
TranslatedSID BinaryLength AceQualifier IsCallback OpaqueLength AccessMask SecurityIdentifier AceType AceFlags IsInherited
------------- ------------ ------------ ---------- ------------ ---------- ------------------ ------- -------- -----------
NT AUTHORITY\BATCH 20 AccessAllowed False 0 2032127 S-1-5-3 AccessAllowed None False
NT AUTHORITY\INTERACTIVE 20 AccessAllowed False 0 2032127 S-1-5-4 AccessAllowed None False
NT AUTHORITY\SERVICE 20 AccessAllowed False 0 2032127 S-1-5-6 AccessAllowed None False
BUILTIN\Administrators 24 AccessAllowed False 0 983059 S-1-5-32-544 AccessAllowed None False
24 AccessAllowed False 0 983059 S-1-5-32-547 AccessAllowed None False
BUILTIN\Server Operators 24 AccessAllowed False 0 983059 S-1-5-32-549 AccessAllowed None False
Accessmask:
Unresolvable SID “S-1-5-32-547” is called “DOMAIN_ALIAS_RID_SYSTEM_OPS” (Source: Well-known SIDs - Win32 apps | Microsoft Learn)
Accessmask Permissions (Source: ADS_RIGHTS_ENUM (iads.h) - Win32 apps | Microsoft Learn):
| Value | Details |
|---|---|
| 1 | ADS_RIGHT_DS_CREATE_CHILD |
| 983059 | ADS_RIGHT_DELETE, ADS_RIGHT_READ_CONTROL, ADS_RIGHT_WRITE_DAC, ADS_RIGHT_WRITE_OWNER, ADS_RIGHT_SYNCHRONIZE, ADS_RIGHT_DS_CREATE_CHILD, ADS_RIGHT_DS_DELETE_CHILD, ADS_RIGHT_ACTRL_DS_LIST, ADS_RIGHT_DS_SELF, ADS_RIGHT_DS_READ_PROP, ADS_RIGHT_DS_WRITE_PROP, ADS_RIGHT_DS_DELETE_TREE, ADS_RIGHT_DS_LIST_OBJECT, ADS_RIGHT_DS_CONTROL_ACCESS1 |
| 2032127 | ADS_RIGHT_DS_CREATE_CHILD, ADS_RIGHT_DS_DELETE_CHILD, ADS_RIGHT_ACTRL_DS_LIST, ADS_RIGHT_DS_SELF, ADS_RIGHT_DS_READ_PROP, ADS_RIGHT_DS_WRITE_PROP, ADS_RIGHT_DS_DELETE_TREE, ADS_RIGHT_DS_LIST_OBJECT, ADS_RIGHT_DS_CONTROL_ACCESS1 |
This should be the most relevant data from my notes.
I don’t say this finding is irrelevant, because as long as there are old/unsecure windows versions it needs to be reconfigured. Up to date environments should not have a security issue here, but it should be configured in any case by GPO so a global default gets enforced.
best regards
Andi/Andy/An-Dir/Andreas Rinner