Skip to content

Commit 90c206f

Browse files
authored
Update atexec.py
Signed-off-by: Kahvi-0xFF <46513413+Kahvi-0@users.noreply.github.com>
1 parent 4c8e8f0 commit 90c206f

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

nxc/protocols/smb/atexec.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def gen_xml(self, command):
111111
random.shuffle(idleSettings)
112112
randomized_idleSettings = "\n".join(idleSettings)
113113

114-
cmd_path = "C:\Windows\System32\cmd"
114+
cmd_path = 'C:\Windows\System32\cmd'
115115
cmd_args = f"/c {command}"
116116

117117
xml = f"""<?xml version="1.0" encoding="UTF-16"?>
@@ -170,7 +170,6 @@ def execute_handler(self, command):
170170
dce.set_credentials(*self.__rpctransport.get_credentials())
171171
dce.connect()
172172
xml = self.gen_xml(command)
173-
174173
self.logger.debug(f"Task XML: {xml}")
175174
self.logger.info(f"Creating task \\{self.task_name}")
176175
try:
@@ -213,8 +212,8 @@ def execute_handler(self, command):
213212
self.logger.fail("ATEXEC: Could not retrieve output file, it may have been detected by AV. Please increase the number of tries with the option '--get-output-tries'. If it is still failing, try the 'wmi' protocol or another exec method")
214213
break
215214
if "STATUS_BAD_NETWORK_NAME" in str(e):
216-
self.logger.fail(f"ATEXEC: Getting the output file failed - target has blocked access to the share: {self.__share} (but the command may have executed!)")
217-
break
215+
self.logger.fail(f"ATEXEC: Getting the output file failed - target has blocked access to the share: {self.__share} (but the command may have executed!)")
216+
break
218217
elif "STATUS_VIRUS_INFECTED" in str(e):
219218
self.logger.fail("Command did not run because a virus was detected")
220219
break

0 commit comments

Comments
 (0)