Skip to content

Commit 2e493f7

Browse files
readd exit(1)s for parameter missing failures
1 parent e348965 commit 2e493f7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

nxc/modules/add-computer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import ssl
22
import ldap3
33
from impacket.dcerpc.v5 import samr, epm, transport
4-
4+
import sys
55

66
class NXCModule:
77
"""
@@ -40,6 +40,7 @@ def options(self, context, module_options):
4040

4141
if "CHANGEPW" in module_options and ("NAME" not in module_options or "PASSWORD" not in module_options):
4242
context.log.error("NAME and PASSWORD options are required!")
43+
sys.exit(1)
4344
elif "CHANGEPW" in module_options:
4445
self.__noAdd = True
4546

@@ -49,11 +50,13 @@ def options(self, context, module_options):
4950
self.__computerName += "$"
5051
else:
5152
context.log.error("NAME option is required!")
53+
sys.exit(1)
5254

5355
if "PASSWORD" in module_options:
5456
self.__computerPassword = module_options["PASSWORD"]
5557
elif "PASSWORD" not in module_options and not self.__delete:
5658
context.log.error("PASSWORD option is required!")
59+
sys.exit(1)
5760

5861
def on_login(self, context, connection):
5962
self.__domain = connection.domain

0 commit comments

Comments
 (0)