I wonder what’s the reasoning behind using the subprocess.check_output() instead of the subprocess.Popen()?
It feels to me like a better solution, since it would work on all commands, and there would be no need to add all wanted commands (like ‘cd’) separately.
From what i understand, using ‘stdout’ and ‘stderr’ = subprocess.PIPE provides all the functionality with less code, and supports all future commands (not only ‘cd’).
Is there something else to consider, that makes you choose subprocess.check_output() in your videos?
I don’t understand this sentence from .Popen documentation: “Execute a child program in a new process”. Maybe that’s what is undesirable in a backdoor?
Yeah see I chose to implement the cd like this because it is a more clean way of doing it, also doing it using the check_output or Popen will have the same effect which would basically execute the command successfully but won’t actually change the working directory.
And yes I wanted the commands to be executed in the same process, that way the backdoor will pause and only continue running once the command finishes execution.