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
ifk!="TimeGenerated": # from the wcc module, but this is a small hack to get it to stop spamming - TODO: add in method to disable output for this function
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")
193
196
break
194
-
ifstr(e).find("STATUS_BAD_NETWORK_NAME") >0:
197
+
if"STATUS_BAD_NETWORK_NAME"instr(e):
195
198
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!)")
self.logger.fail("MMCEXEC: 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")
259
262
break
260
-
ifstr(e).find("STATUS_BAD_NETWORK_NAME") >0:
263
+
if"STATUS_BAD_NETWORK_NAME"instr(e):
261
264
self.logger.fail(f"MMCEXEC: Getting the output file failed - target has blocked access to the share: {self.__share} (but the command may have executed!)")
cmd_exec_group=smb_parser.add_argument_group("Command Execution", "Options for executing commands")
70
70
cmd_exec_group.add_argument("--exec-method", choices={"wmiexec", "mmcexec", "smbexec", "atexec"}, default="wmiexec", help="method to execute the command. Ignored if in MSSQL mode")
cmd_exec_group.add_argument("--get-output-tries", help="Number of times atexec/smbexec/mmcexec tries to get results", type=int, default=5)
72
+
cmd_exec_group.add_argument("--get-output-tries", help="Number of times atexec/smbexec/mmcexec tries to get results", type=int, default=10)
73
73
cmd_exec_group.add_argument("--codec", default="utf-8", help="Set encoding used (codec) from the target's output. If errors are detected, run chcp.com at the target & map the result with https://docs.python.org/3/library/codecs.html#standard-encodings and then execute again with --codec and the corresponding codec")
74
74
cmd_exec_group.add_argument("--no-output", action="store_true", help="do not retrieve command output")
self.logger.fail("SMBEXEC: 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")
150
151
break
151
-
ifstr(e).find("STATUS_BAD_NETWORK_NAME") >0:
152
+
if"STATUS_BAD_NETWORK_NAME"instr(e):
152
153
self.logger.fail(f"SMBEXEC: Getting the output file failed - target has blocked access to the share: {self.__share} (but the command may have executed!)")
self.logger.fail("wmiexec: Could not retrieve output file, it may have been detected by AV. If it is still failing, try the 'wmi' protocol or another exec method")
152
154
break
153
-
elifstr(e).find("STATUS_BAD_NETWORK_NAME") >0:
155
+
elif"STATUS_BAD_NETWORK_NAME"instr(e):
154
156
self.logger.fail(f"SMB connection: target has blocked {self.__share} access (maybe command executed!)")
155
157
break
156
-
elifstr(e).find("STATUS_VIRUS_INFECTED") >=0:
158
+
elif"STATUS_VIRUS_INFECTED"instr(e):
157
159
self.logger.fail("Command did not run because a virus was detected")
0 commit comments