抓包分析 TLS 1.2 连接过程

本文是《Traffic Analysis of an SSL/TLS Session》的笔记,原文见此处。 在 TLS 协议格式 中详细分析了协议数据的各个字段, 现在就来实战 ——用 Wireshark 抓包并观察数据。 第一发(Client -> Server) Full contents of the packet 0000 02 00 00 00 45 00 00 98 13 ed 40 00 40 06 00 00 ....E.....@.@... 0010 7f 00 00 01 7f 00 00 01 ec 26 01 bb 43 7c ee 74 .........&..C|.t 0020 60 b5 50 0a 80 18 31 d7 fe 8c 00 00 01 01 08 0a `....

2016-06-19 · Me

TLS 1.2 协议格式

本文内容来自《Traffic Analysis of an SSL/TLS Session》的阅读笔记,原文见此处。 TLS 全称为 Transport Layer Security,它本身也分为了 Lower 和 Higher 两层协议。 Lower Layer Lower Layer 协议在 TCP 协议之上,提供面向连接的可靠传输,在这一层的协议主要是记录协议(TLS Record Protocol)。 记录协议首先把上层协议传来的数据分成小于2^14字节的数据块,如果设置了压缩选项,则第二步为压缩数据,然后在数据块的末尾增加 MAC(Message Authentication Code),第三步将数据块加密,最后增加记录头。该过程如下所示。 each block is packed into a structure that does not preserve client message boundaries, meaning that mulitiple message of the same type maybe coalesced into a single structure -----------+ data --+--------------> 1. Fragment data -----------+ +------------------------+ | | | | +------------------------+ 2. Compress data (generally no compression applied) +------------------------+----+ | |MAC | Add a Message Authentication Code | | | +------------------------+----+ 3....

2016-06-18 · Me