vagd.virts.shgd
Classes
Run SSH processes behind a one-shot TCP listener. |
|
ssh interface for pwntools |
Module Contents
- class vagd.virts.shgd._SocketSSH(ssh: pwnlib.tubes.ssh.ssh)
Run SSH processes behind a one-shot TCP listener.
- _LISTEN = 'TCP4-LISTEN:0,bind=127.0.0.1'
- _PORT
- _ssh
- __getattr__(name: str) Any
- connect_remote(*args: Any, **kwargs: Any) pwnlib.tubes.sock.sock
Connect through SSH without leaking Paramiko teardown races.
- process(argv: Any = None, **kwargs: Any) pwnlib.tubes.sock.sock
Create the process with pwntools’ execve wrapper, then let socat run it.
The listener intentionally has neither a fixed port nor socat’s listener
forkoption. It accepts exactly one connection and terminates its child when that connection closes.
- class vagd.virts.shgd.Shgd(binary: str, user: str = DEFAULT_USER, host: str = DEFAULT_HOST, port: int = DEFAULT_PORT, keyfile: str = Pwngd.KEYFILE, **kwargs: Any)
Bases:
vagd.virts.pwngd.Pwngdssh interface for pwntools
- Parameters:
binary – binary to execute
user – ssh user
host – ssh hostname
port – ssh port
keyfile – ssh keyfile (default in .vagd)
kwargs – parameters to pass through to super
- DEFAULT_HOST = 'localhost'
- DEFAULT_PORT = 22
- DEFAULT_USER = 'root'
- DEFAULT_PACKAGES = ['gdbserver', 'python3', 'sudo', 'socat']
- _user: str
- _host: str
- _port: int
- _keyfile: str
- _ssh: pwnlib.tubes.ssh.ssh
- _transport(socket: bool = False) Any
Return the process transport supplied by the concrete backend.
- bind(port: int) int
bind port from ssh connection locally :param port: :return:
- _vm_setup() None
pass
- _TRIES = 3
- _ssh_setup() None
setup ssh connection