Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #34875
    Bartosz
    Participant

    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!

    #34957
    Zaid Sabih
    Moderator

    Hello 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.

    #34984
    Bartosz
    Participant

    I see.
    Makes sense 🙂
    Thank you!

    #35102
    Vashisht Boodhun
    Participant

    You’re welcome, I’m glad we could help:)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.