Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.
This repository was archived by the owner on May 26, 2020. It is now read-only.

How run_script.py copy and exec script #15

@weburnit

Description

@weburnit

Fix me if I'm wrong
I don't know how you guys can copy and run the script within this function in attacks.run_script.RunScript#_run_script

    def _run_script(self, host, user, local_script, remote_script, pem):
        """
        Copy a script to a remote host and exec it.
        """
        self.log.info("running %s in node %s", local_script, host)

        pem_decoded = base64.b64decode(pem).decode()

        temp = tempfile.NamedTemporaryFile('w', delete=False)
        temp.write(pem_decoded)
        temp.flush()
        temp.close()

        self.log.info("connect ssh client to %s with user %s", host, user)
        self.log.info("Executing remote script")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions