diff --git a/shuffle-tools/1.2.0/src/app.py b/shuffle-tools/1.2.0/src/app.py index 4707538c..78e84860 100644 --- a/shuffle-tools/1.2.0/src/app.py +++ b/shuffle-tools/1.2.0/src/app.py @@ -2632,10 +2632,19 @@ def run_ssh_command(self, host, port, user_name, private_key_file_id, password, try: stdin, stdout, stderr = ssh_client.exec_command(str(command)) + try: + errorLog = stderr.read().decode(errors='ignore') + except Exception as e: + errorLog = f"Failed to read stderr {e}" + try: + output = stdout.read().decode(errors='ignore') + except Exception as e: + output = f"Failed to read stdout {e}" + except Exception as e: return {"success":"false","message":str(e)} - return {"success":"true","output": stdout.read().decode(errors='ignore')} + return {"success":"true","output": output, "error_logs": errorLog} def cleanup_ioc_data(self, input_data): # Remove unecessary parts like { and }, quotes etc