You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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")
235
-
break
236
-
if"STATUS_BAD_NETWORK_NAME"instr(e):
220
+
whileTrue:
221
+
try:
222
+
self.logger.info(f"Attempting to read {self.__share}\\{self.__output_filename}")
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")
228
+
break
229
+
if"STATUS_BAD_NETWORK_NAME"instr(e):
237
230
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!)")
238
231
break
239
-
elif"STATUS_VIRUS_INFECTED"instr(e):
240
-
self.logger.fail("Command did not run because a virus was detected")
241
-
break
242
-
# When executing PowerShell and the command is still running, we get a sharing violation
243
-
# We can use that information to wait longer than if the file is not found (probably av or something)
244
-
if"STATUS_SHARING_VIOLATION"instr(e):
245
-
self.logger.info(f"File {self.__share}\\{self.__output_filename} is still in use with {self.__tries-tries} tries left, retrying...")
246
-
tries+=1
247
-
sleep(1)
248
-
elif"STATUS_OBJECT_NAME_NOT_FOUND"instr(e):
249
-
self.logger.info(f"File {self.__share}\\{self.__output_filename} not found with {self.__tries-tries} tries left, deducting 10 tries and retrying...")
250
-
tries+=10
251
-
sleep(1)
252
-
else:
253
-
self.logger.debug(f"Exception when trying to read output file: {e!s}. {self.__tries-tries} tries left, retrying...")
0 commit comments