Skip to content

Commit dffd862

Browse files
committed
linting
1 parent 46574d4 commit dffd862

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

nxc/modules/wcc.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from nxc.logger import nxc_logger
1010
from impacket.dcerpc.v5 import rrp, samr, scmr
1111
from impacket.dcerpc.v5.rrp import DCERPCSessionError
12+
from impacket.dcerpc.v5.rpcrt import DCERPCException
1213
from impacket.smbconnection import SessionError as SMBSessionError
1314
from impacket.examples.secretsdump import RemoteOperations
1415

@@ -357,7 +358,7 @@ def check_single_registry_with_policy(self, *spec, options=None):
357358
reasons = ["Check could not be performed (invalid specification provided)"]
358359
return ok, reasons
359360
except Exception as e:
360-
ok, reasons = self.module.log.error(f"Check could not be performed. Details: specs={specs}, dce={self.dce}, error: {e}")
361+
ok, reasons = self.module.log.error(f"Check could not be performed. Details: spec={spec}, dce={self.dce}, error: {e}")
361362
return ok, reasons
362363

363364
ok, reasons_p = self.check_registry((policy_key, value_name, expected_value, op), stop_on_error=True)
@@ -529,8 +530,8 @@ def check_applocker(self):
529530
def get_exclusions(self, key_name):
530531
exclusions = []
531532
try:
532-
values = self.reg_query_value(self.dce, self.connection, key_name, valueName=None, all=True)
533-
for value_type, value_name, value_data in values:
533+
values = self.reg_query_value(self.dce, self.connection, key_name, valueName=None, all_value=True)
534+
for _, value_name, _ in values:
534535
exclusions.append(value_name)
535536
except Exception:
536537
self.context.log.debug("No defender exclusion policies")
@@ -546,7 +547,7 @@ def check_defender_exclusion(self, *spec, options=None):
546547
reasons = ["Check could not be performed (invalid specification provided)"]
547548
return ok, reasons
548549
except Exception as e:
549-
ok, reasons = self.module.log.error(f"Check could not be performed. Details: specs={specs}, dce={self.dce}, error: {e}")
550+
ok, reasons = self.module.log.error(f"Check could not be performed. Details: spec={spec}, dce={self.dce}, error: {e}")
550551
return ok, reasons
551552

552553
reasons = []
@@ -649,7 +650,7 @@ def reg_get_subkeys(self, dce, connection, key_name):
649650
break
650651
return subkeys
651652

652-
def reg_query_value(self, dce, connection, keyName, valueName=None, all=False):
653+
def reg_query_value(self, dce, connection, keyName, valueName=None, all_value=False):
653654
"""Query remote registry data for a given registry value"""
654655

655656
def subkey_values(subkey_handle):
@@ -702,9 +703,9 @@ def get_value(subkey_handle, dwIndex=0):
702703

703704
subkey_handle = ans["phkResult"]
704705

705-
if valueName is None and all is False:
706+
if valueName is None and all_value is False:
706707
return get_value(subkey_handle)[2]
707-
elif valueName is None and all is True:
708+
elif valueName is None and all_value is True:
708709
return subkey_values(subkey_handle)
709710
else:
710711
for _, name, data in subkey_values(subkey_handle):

0 commit comments

Comments
 (0)