1 #ifndef PACKETPP_SSH_LAYER 2 #define PACKETPP_SSH_LAYER 95 static bool isSSHPort(uint16_t portSrc, uint16_t portDst) {
return portSrc == 22 || portDst == 22; }
114 SSHLayer(uint8_t* data,
size_t dataLen,
Layer* prevLayer,
Packet* packet) :
Layer(data, dataLen, prevLayer, packet) { m_Protocol =
SSH; }
136 std::string getIdentificationMessage();
198 SSH_MSG_KEX_INIT = 20,
200 SSH_MSG_NEW_KEYS = 21,
202 SSH_MSG_KEX_DH_INIT = 30,
204 SSH_MSG_KEX_DH_REPLY = 31,
206 SSH_MSG_KEX_DH_GEX_INIT = 32,
208 SSH_MSG_KEX_DH_GEX_REPLY = 33,
210 SSH_MSG_KEX_DH_GEX_REQUEST = 34,
212 SSH_MSG_UNKNOWN = 999
223 std::string getMessageTypeStr()
const;
228 uint8_t* getSSHHandshakeMessage()
const;
235 size_t getSSHHandshakeMessageLength()
const;
240 size_t getPaddingLength()
const;
269 #pragma pack(push, 1) 272 uint32_t packetLength;
273 uint8_t paddingLength;
313 uint8_t* getCookie();
321 std::string getCookieAsHexStream();
388 bool isFirstKexPacketFollows();
391 size_t m_FieldOffsets[11];
392 bool m_OffsetsInitialized;
394 void parseMessageAndInitOffsets();
396 std::string getFieldValue(
int fieldOffsetIndex);
430 #endif // PACKETPP_SSH_LAYER The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:253
std::string getCompressionAlgorithmsServerToClient()
Definition: SSHLayer.h:369
SSHHandshakeMessageType
Definition: SSHLayer.h:195
std::string getMacAlgorithmsServerToClient()
Definition: SSHLayer.h:357
std::string getServerHostKeyAlgorithms()
Definition: SSHLayer.h:333
Definition: ProtocolType.h:268
Definition: SSHLayer.h:189
std::string getLanguagesClientToServer()
Definition: SSHLayer.h:375
std::string getMacAlgorithmsClientToServer()
Definition: SSHLayer.h:351
const ProtocolType SSH
Definition: ProtocolType.h:233
std::string getEncryptionAlgorithmsServerToClient()
Definition: SSHLayer.h:345
Definition: SSHLayer.h:270
Definition: SSHLayer.h:294
size_t getHeaderLen() const
Definition: SSHLayer.h:423
std::string getEncryptionAlgorithmsClientToServer()
Definition: SSHLayer.h:339
size_t getHeaderLen() const
Definition: SSHLayer.h:155
static bool isSSHPort(uint16_t portSrc, uint16_t portDst)
Definition: SSHLayer.h:95
std::string getCompressionAlgorithmsClientToServer()
Definition: SSHLayer.h:363
void computeCalculateFields()
Definition: SSHLayer.h:108
SSHEncryptedMessage(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: SSHLayer.h:416
std::string getKeyExchangeAlgorithms()
Definition: SSHLayer.h:327
static SSHLayer * createSSHMessage(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
OsiModelLayer getOsiModelLayer() const
Definition: SSHLayer.h:110
virtual std::string toString() const =0
Definition: SSHLayer.h:72
std::string getLanguagesServerToClient()
Definition: SSHLayer.h:381
Definition: SSHLayer.h:130
Definition: SSHLayer.h:408
virtual size_t getHeaderLen() const =0