Skip to content

Commit b2aac4e

Browse files
authored
Merge pull request Pennyw0rth#701 from fpreynaud/wcc_llmnr
[WCC] Improve NBTNS check and add LLMNR check
2 parents 97049a0 + d4168b4 commit b2aac4e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

nxc/modules/wcc.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def init_checks(self):
179179
ConfigCheck("CredentialGuard enabled", "Checks if CredentialGuard is enabled", checker_args=[[self, ("HKLM\\SYSTEM\\CurrentControlSet\\Control\\DeviceGuard", "EnableVirtualizationBasedSecurity", 1), ("HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa", "LsaCfgFlags", 1)]]),
180180
ConfigCheck("Lsass run as PPL", "Checks if lsass runs as a protected process", checker_args=[[self, ("HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa", "RunAsPPL", 1)]]),
181181
ConfigCheck("No Powershell v2", "Checks if powershell v2 is available", checker_args=[[self, ("HKLM\\SOFTWARE\\Microsoft\\PowerShell\\3\\PowerShellEngine", "PSCompatibleVersion", "2.0", not_(operator.contains))]]),
182+
ConfigCheck("LLMNR disabled", "Checks if LLMNR is disabled", checker_args=[[self, ("HKLM\\Software\\policies\\Microsoft\\Windows NT\\DNSClient", "EnableMulticast", 0)]]),
182183
ConfigCheck("LmCompatibilityLevel == 5", "Checks if LmCompatibilityLevel is set to 5", checker_args=[[self, ("HKLM\\SYSTEM\\CurrentControlSet\\Control\\Lsa", "LmCompatibilityLevel", 5, operator.ge)]]),
183184
ConfigCheck("NBTNS disabled", "Checks if NBTNS is disabled on all interfaces", checkers=[self.check_nbtns]),
184185
ConfigCheck("mDNS disabled", "Checks if mDNS is disabled", checker_args=[[self, ("HKLM\\SYSTEM\\CurrentControlSet\\Services\\DNScache\\Parameters", "EnableMDNS", 0)]]),
@@ -454,13 +455,21 @@ def check_wsus_running(self):
454455
return ok, reasons
455456

456457
def check_nbtns(self):
458+
adapters_key = "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4d36e972-e325-11ce-bfc1-08002be10318}"
457459
key_name = "HKLM\\SYSTEM\\CurrentControlSet\\Services\\NetBT\\Parameters\\Interfaces"
458460
subkeys = self.reg_get_subkeys(self.dce, self.connection, key_name)
459461
success = False
460462
reasons = []
461463
missing = 0
462464
nbtns_enabled = 0
465+
463466
for subkey in subkeys:
467+
# Ignore Microsoft Kernel Debug Network Adapter
468+
kdnic_key = adapters_key + "\\0000"
469+
kdnic_uuid = self.reg_query_value(self.dce, self.connection, kdnic_key, "NetCfgInstanceId")
470+
if subkey.lower() == ("Tcpip_" + kdnic_uuid).replace("\x00", "").lower():
471+
continue
472+
464473
value = self.reg_query_value(self.dce, self.connection, key_name + "\\" + subkey, "NetbiosOptions")
465474
if isinstance(value, DCERPCSessionError):
466475
if value.error_code == ERROR_OBJECT_NOT_FOUND:

0 commit comments

Comments
 (0)