- This topic has 3 replies, 3 voices, and was last updated 4 years, 7 months ago by Vashisht Boodhun.
- AuthorPosts
- April 24, 2020 at 9:30 pm #34875BartoszParticipant
Hi,
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?Thanks for all the great content and support!
April 26, 2020 at 1:37 am #34957Zaid SabihModeratorHello Bartosz,
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.April 26, 2020 at 9:09 am #34984BartoszParticipantI see.
Makes sense 🙂
Thank you!April 27, 2020 at 4:22 pm #35102Vashisht BoodhunParticipantYou’re welcome, I’m glad we could help:)
- AuthorPosts
- You must be logged in to reply to this topic.