private NetworkHash SearchSmtpCramMd5(TcpSession tcpSession, string sessionData) { NetworkHash credential = null; Match match = _smtpCramMd5Regex.Match(sessionData); if (match.Success) { credential = new CramMd5Hash() { Protocol = "SMTP", HashType = "CRAM-MD5", Hash = match.Groups["Hash"].ToString(), Challenge = match.Groups["Challenge"].ToString(), Source = tcpSession.SourceIp, Destination = tcpSession.DestinationIp }; } return(credential); }
private NetworkLayerObject SearchImapCramMd5Hash(TcpSession tcpSession, string sessionData) { NetworkHash hash = null; Match match = _imapCramMd5Regex.Match(sessionData); if (match.Success) { // TODO: Handle the triming at the regex. hash = new CramMd5Hash() { Protocol = "IMAP", HashType = "CRAM-MD5", Challenge = match.Groups["Challenge"].Value, Hash = match.Groups["Response"].Value, Source = tcpSession.SourceIp, Destination = tcpSession.DestinationIp }; } return(hash); }