99
1010
1111class TSCH_EXEC :
12- def __init__ (self , target , share_name , username , password , domain , doKerberos = False , aesKey = None , remoteHost = None ,
13- kdcHost = None , hashes = None , logger = None , tries = None , share = None ,
12+ def __init__ (self , target , share_name , username , password , domain , doKerberos = False , aesKey = None , remoteHost = None , kdcHost = None , hashes = None , logger = None , tries = None , share = None ,
1413 # These options are used by the schtask_as module, except the run_task_as
1514 # that defaults to NT AUTHORITY\System user (SID S-1-5-18) if not specified
1615 run_task_as = "S-1-5-18" , run_cmd = None , output_filename = None , task_name = None , output_file_location = None ):
@@ -32,6 +31,7 @@ def __init__(self, target, share_name, username, password, domain, doKerberos=Fa
3231 self .__share = share
3332 self .logger = logger
3433
34+ # Optional args for finetuning the task execution, e.g. used in nxc/modules/schtask_as.py
3535 self .task_name = task_name if task_name else gen_random_string (8 )
3636 self .run_task_as = run_task_as
3737 self .run_cmd = run_cmd
@@ -116,11 +116,11 @@ def gen_xml(self, command):
116116 <Command>cmd.exe</Command>
117117 """
118118 if self .__retOutput :
119- fileLocation = "\\ Windows\\ Temp\\ " if self .output_file_location is None else self .output_file_location
119+ file_location = "\\ Windows\\ Temp\\ " if self .output_file_location is None else self .output_file_location
120120 if self .output_filename is None :
121- self .__output_filename = os .path .join (fileLocation , gen_random_string (6 ))
121+ self .__output_filename = os .path .join (file_location , gen_random_string (6 ))
122122 else :
123- self .__output_filename = os .path .join (fileLocation , self .output_filename )
123+ self .__output_filename = os .path .join (file_location , self .output_filename )
124124 argument_xml = f" <Arguments>/C { command } > { self .__output_filename } 2>&1</Arguments>"
125125
126126 elif self .__retOutput is False :
0 commit comments