MCPcopy
hub / github.com/jtesta/ssh-audit / send

Method send

src/ssh_audit/ssh_socket.py:225–232  ·  view source on GitHub ↗
(self, data: bytes)

Source from the content-addressed store, hash-verified

223 return len(data), None
224
225 def send(self, data: bytes) -> Tuple[int, Optional[str]]:
226 if self.__sock is None:
227 return -1, 'not connected'
228 try:
229 self.__sock.send(data)
230 return 0, None
231 except socket.error as e:
232 return -1, str(e.args[-1])
233
234 # Send a KEXINIT with the lists of key exchanges, hostkeys, ciphers, MACs, compressions, and languages that we "support".
235 def send_kexinit(self, key_exchanges: List[str] = ['curve25519-sha256', 'curve25519-sha256@libssh.org', 'ecdh-sha2-nistp256', 'ecdh-sha2-nistp384', 'ecdh-sha2-nistp521', 'diffie-hellman-group-exchange-sha256', 'diffie-hellman-group16-sha512', 'diffie-hellman-group18-sha512', 'diffie-hellman-group14-sha256'], hostkeys: List[str] = ['rsa-sha2-512', 'rsa-sha2-256', 'ssh-rsa', 'ecdsa-sha2-nistp256', 'ssh-ed25519'], ciphers: List[str] = ['chacha20-poly1305@openssh.com', 'aes128-ctr', 'aes192-ctr', 'aes256-ctr', 'aes128-gcm@openssh.com', 'aes256-gcm@openssh.com'], macs: List[str] = ['umac-64-etm@openssh.com', 'umac-128-etm@openssh.com', 'hmac-sha2-256-etm@openssh.com', 'hmac-sha2-512-etm@openssh.com', 'hmac-sha1-etm@openssh.com', 'umac-64@openssh.com', 'umac-128@openssh.com', 'hmac-sha2-256', 'hmac-sha2-512', 'hmac-sha1'], compressions: List[str] = ['none', 'zlib@openssh.com'], languages: List[str] = ['']) -> None: # pylint: disable=dangerous-default-value

Callers 2

send_bannerMethod · 0.95
send_packetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected