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 SabihZaid 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.
Privacy Overview
ZSecurity logo featuring a stylized red letter Z

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

3rd Party Cookies

This website uses Google Analytics and Linkedin to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping these cookies enabled helps us to improve our website.