Skip to content

Commit d0ea79a

Browse files
authored
Merge pull request Pennyw0rth#916 from Pennyw0rth/neff-enforce-category
Enforce that category is one of the enums
2 parents da4a846 + 47ec489 commit d0ea79a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

nxc/loaders/moduleloader.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from os.path import join as path_join
99

1010
from nxc.context import Context
11+
from nxc.helpers.misc import CATEGORY
1112
from nxc.logger import NXCAdapter
1213
from nxc.paths import NXC_PATH
1314

@@ -30,8 +31,8 @@ def module_is_sane(self, module, module_path):
3031
elif not hasattr(module, "description"):
3132
self.logger.fail(f"{module_path} missing the description variable")
3233
module_error = True
33-
elif not hasattr(module, "category"):
34-
self.logger.fail(f"{module_path} missing the category variable")
34+
elif not hasattr(module, "category") or module.category not in [CATEGORY.ENUMERATION, CATEGORY.CREDENTIAL_DUMPING, CATEGORY.PRIVILEGE_ESCALATION]:
35+
self.logger.fail(f"{module_path} missing the category variable or invalid category")
3536
module_error = True
3637
elif not hasattr(module, "supported_protocols"):
3738
self.logger.fail(f"{module_path} missing the supported_protocols variable")

0 commit comments

Comments
 (0)