我需要检测网络流量HTTPS数据包。 直到现在我都标志认证的所有“443”为HTTPS,但我不希望使用的端口信息,对于这种情况了。
这将足以检查客户问候消息,如:
//Check 22 and version info 0300 0301 or 0302
if (packet->payload[0] == 0x16 && packet->payload[1] == 0x03
&& (packet->payload[2] == 0x00 || packet->payload[2] == 0x01 || packet->payload[2] == 0x02)
{
int temp = ntohs(get_u16(packet->payload, 3)) + 5;//Get lenght
//Check lenght is valid and 6th byte is client hello(which is 1)
if (temp < packet->payload_length && temp > 50 && packet->payload[5]) == 1)
MARK AS HTTPS
}
因为我的项目设计的,我无法检查多个数据包。 能否请您告知,如果只是检查客户端问候像上面好不好?