Skip to content

Commit 9c17cf9

Browse files
authored
Update schtask_as.py
Signed-off-by: Kahvi-0xFF <46513413+Kahvi-0@users.noreply.github.com>
1 parent c66ab1a commit 9c17cf9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

nxc/modules/schtask_as.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def on_admin_login(self, context, connection):
9191
except Exception as e:
9292
if "SCHED_S_TASK_HAS_NOT_RUN" in str(e):
9393
self.logger.fail("Task was not run, seems like the specified user has no active session on the target")
94-
exec_method.deleteartifact()
94+
#exec_method.deleteartifact()
9595

9696
class TSCH_EXEC:
9797
def __init__(self, target, share_name, username, password, domain, user, cmd, file, task, location, doKerberos=False, aesKey=None, remoteHost=None, kdcHost=None, hashes=None, logger=None, tries=None, share=None):
@@ -266,6 +266,8 @@ def execute_handler(self, command, fileless=False):
266266
tsch.hSchRpcDelete(dce, f"\\{tmpName}")
267267
if "SCHED_S_TASK_HAS_NOT_RUN" in str(e):
268268
tsch.hSchRpcDelete(dce, f"\\{tmpName}")
269+
if "ERROR_ALREADY_EXISTS" in str(e):
270+
self.logger.fail(f"Schtask_as: Create schedule task failed: {e}")
269271
else:
270272
self.logger.fail(f"Schtask_as: Create schedule task failed: {e}")
271273
tsch.hSchRpcDelete(dce, f"\\{tmpName}")

0 commit comments

Comments
 (0)