Skip to content

Commit 417db64

Browse files
authored
Merge branch 'main' into rdp-nego
2 parents edd3085 + e872b83 commit 417db64

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

nxc/modules/get-userPassword.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ def on_login(self, context, connection):
4141
resp_parsed = parse_result_attributes(resp)
4242
context.log.success("Found following users: ")
4343
for user in resp_parsed:
44-
context.log.highlight(f"User: {user['sAMAccountName']} unixUserPassword: {user['userPassword']}")
44+
context.log.highlight(f"User: {user['sAMAccountName']} userPassword: {user['userPassword']}")
4545
else:
46-
context.log.fail("No unixUserPassword Found")
46+
context.log.fail("No userPassword Found")

nxc/protocols/wmi/wmiexec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def execute_WithOutput(self, command):
6767
self.__registry_Path = f"Software\\Classes\\{gen_random_string(8)}"
6868

6969
# 1. Run the command and write output to file
70-
self.execute_remote(f'{self.__shell} {command} 1> "{result_output}" 2>&1')
70+
self.execute_remote(f'{self.__shell} ({command}) 1> "{result_output}" 2>&1')
7171
self.logger.info(f"Waiting {self.__exec_timeout}s for command to complete.")
7272
time.sleep(self.__exec_timeout)
7373

@@ -109,7 +109,7 @@ def execute_WithOutput_psh(self, command):
109109

110110
# 1. Run the command and write output to file
111111
if not command.lower().startswith("powershell"):
112-
command = f"powershell -Command {command}"
112+
command = f'powershell -Command "& {{{command}}}"'
113113
self.execute_remote(f'{command} > "{result_output}" 2>&1')
114114
self.logger.info(f"Waiting {self.__exec_timeout}s for command to complete.")
115115
time.sleep(self.__exec_timeout)

0 commit comments

Comments
 (0)