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

Method test_ssh1_server_invalid_first_packet

test/test_ssh1.py:144–158  ·  view source on GitHub ↗
(self, output_spy, virtual_socket)

Source from the content-addressed store, hash-verified

142 assert len(lines) == 13
143
144 def test_ssh1_server_invalid_first_packet(self, output_spy, virtual_socket):
145 vsocket = virtual_socket
146 w = self.wbuf()
147 w.write_byte(self.protocol.SMSG_PUBLIC_KEY + 1)
148 w.write(self._pkm_payload())
149 vsocket.rdata.append(b'SSH-1.5-OpenSSH_7.2 ssh-audit-test\r\n')
150 vsocket.rdata.append(self._create_ssh1_packet(w.write_flush()))
151 output_spy.begin()
152 out = self.OutputBuffer()
153 ret = self.audit(out, self._conf())
154 out.write()
155 assert ret != 0
156 lines = output_spy.flush()
157 assert len(lines) == 6
158 assert 'unknown message' in lines[-1]
159
160 def test_ssh1_server_invalid_checksum(self, output_spy, virtual_socket):
161 vsocket = virtual_socket

Callers

nothing calls this directly

Calls 9

_pkm_payloadMethod · 0.95
_create_ssh1_packetMethod · 0.95
_confMethod · 0.95
writeMethod · 0.95
write_byteMethod · 0.80
write_flushMethod · 0.80
beginMethod · 0.80
flushMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected