From 4d2ab762bd9de4a71c1d2ecef898d65c4e2e70cb Mon Sep 17 00:00:00 2001 From: Marshall Hallenbeck Date: Sat, 14 Oct 2023 17:44:52 -0400 Subject: [PATCH] refactor: simplify logic --- nxc/modules/get-desc-users.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/nxc/modules/get-desc-users.py b/nxc/modules/get-desc-users.py index 5934a561..7850f327 100644 --- a/nxc/modules/get-desc-users.py +++ b/nxc/modules/get-desc-users.py @@ -107,11 +107,8 @@ class NXCModule: conditionPasswordPolicy = False if self.regex.search(description): conditionPasswordPolicy = True - - if self.FILTER and conditionFilter and self.PASSWORDPOLICY and conditionPasswordPolicy: - answersFiltered.append([answer[0], description]) - elif not self.FILTER and self.PASSWORDPOLICY and conditionPasswordPolicy: - answersFiltered.append([answer[0], description]) - elif not self.PASSWORDPOLICY and self.FILTER and conditionFilter: - answersFiltered.append([answer[0], description]) + + if (self.FILTER and conditionFilter) or (not self.FILTER and not conditionFilter): + if (self.PASSWORDPOLICY and conditionPasswordPolicy) or (not self.PASSWORDPOLICY and not conditionPasswordPolicy): + answersFiltered.append([answer[0], description]) return answersFiltered