@@ -720,11 +720,26 @@ def agent_stopped(self):
720720 return self .wasStopped
721721
722722 def run_health_check (self , attack , hashlist_alias ):
723- args = " --machine-readable --quiet"
724- args += " --restore-disable --potfile-disable --session=health "
725- args += update_files (attack ).replace (hashlist_alias , "'" + self .config .get_value ('hashlists-path' ) + "/health_check.txt'" )
726- args += " -o '" + self .config .get_value ('hashlists-path' ) + "/health_check.out'"
727- full_cmd = f"{ self .callPath } " + args
723+ args = []
724+ args .append ('--machine-readable' )
725+ args .append ('--quiet' )
726+ args .append ('--restore-disable' )
727+ args .append ('--potfile-disable' )
728+ args .append ('--session=health' )
729+ attackcmd = update_files (attack )
730+ hashlist_path = Path (self .config .get_value ('hashlists-path' ), "health_check.txt" )
731+ hashlist_out_path = Path (self .config .get_value ('hashlists-path' ), "health_check.out" )
732+
733+ # Replace #HL# with the real hashlist
734+ attackcmd = attackcmd .replace (hashlist_alias , f'"{ hashlist_path } "' )
735+
736+ args .append (attackcmd )
737+ args .append ('-o' )
738+ args .append (f'"{ hashlist_out_path } "' )
739+
740+ full_cmd = ' ' .join (args )
741+ full_cmd = f"{ self .callPath } { full_cmd } "
742+
728743 if Initialize .get_os () == 1 :
729744 full_cmd = full_cmd .replace ("/" , '\\ ' )
730745 logging .debug (f"CALL: { '' .join (full_cmd )} " )
0 commit comments