Skip to content

💡 [REQUEST] - Remote Command Execution - Support for SSH #50

@d3sch41n

Description

@d3sch41n

Implementation PR

No response

Reference Issues

No response

Summary

Dedicated yaml syntax for ssh remote command execution:

Basic Example

It could look like this:

steps:
  - name: establish_ssh_session 
    create_remote_session:
      name: my_session 
      ssh_cmd: ssh -i ${MY_KEYFILE} ${MY_USER}@${MY_HOST_ARG} 
  - name: execute_remote_commands
    remote_session: my_session
    inline: | 
      hostname
      whoami

We can support this natively in golang with the appropriate package:

https://stackoverflow.com/a/41528181

Although we may want to just pipe stdin to a real ssh process - that's "hacky" but
would create more realistic telemetry of attacker activity so hacky might be significantly better in this instance.

Later, We can extend the create_remote_session architecture to support connecting to a remote C2 implant, use WinRM, etc

Drawbacks

No response

Unresolved questions

  • Is there a way we could design this to support nested pivots (SSH chains)?
  • is there extra glue we need to do to make the telemetry look more real (like making ssh think it's attached to a real tty)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionClarification and/or additional information required to move forwardtype/major

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions