Skip to content
Wireshark Wiki 中文翻译整理专题首页原始页面

ESP

ESP 用于提供机密性、数据源认证、无连接完整性、防重放服务(一种部分序列完整性的形式)以及有限的流量流机密性。目前 ESP 主要由以下 RFC 描述:

  • RFC4301, Security Architecture for the Internet Protocol, S. Kent, K. Seo, December 2005, PROPOSED STANDARD.

  • RFC4303, IP Encapsulating Security Payload (ESP), S. Kent, December 2005, PROPOSED STANDARD.

要使用的算法及其要求在 RFC4305 中描述:Cryptographic Algorithm Implementation Requirements for Encapsulating Security Payload (ESP) and Authentication Header (AH), D. Eastlake 3rd, December 2005, PROPOSED STANDARD.

您也可以使用其他一些 Cryptographic Algorithms(请查看 IANA 以获取其他示例)。

ESP 算法(RFC 4305)

ESP Format 如下:

 0 1 2 3  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Security Parameters Index (SPI) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Payload Data (variable) | ~ ~ | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Padding (0-255 bytes) | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Pad Length | Next Header | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Authentication Data (variable) | ~ ~ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

ESP 要求

以下 RFC4305 表格列出了 IPsec Encapsulating Security Payload 协议的 Encryption 和 Authentication 算法。

Requirement Encryption Algorithm (notes)----------- --------------------MUST NULL (1)MUST- TripleDES-CBC [RFC2451]SHOULD+ AES-CBC with 128-bit keys [RFC3602]SHOULD AES-CTR [RFC3686]SHOULD NOT DES-CBC [RFC2405] (3)Requirement Authentication Algorithm (notes)----------- ------------------------MUST HMAC-SHA1-96 [RFC2404]MUST NULL (1)SHOULD+ AES-XCBC-MAC-96 [RFC3566]MAY HMAC-MD5-96 [RFC2403] (2)Notes:(1) Since ESP Encryption and Authentication are optional, support for the two "NULL" algorithms is required to maintain consistency with the way these services are negotiated. Note that while Authentication and Encryption can each be "NULL", they MUST NOT both be "NULL".(2) Weaknesses have become apparent in MD5; however, these should not affect the use of MD5 with HMAC.(3) DES, with its small key size and publicly demonstrated and open-design special-purpose cracking hardware, is of questionable security for general use.

Wireshark

ESP dissector 已完全可用。如果 Wireshark 链接了 libgcrypt,Wireshark 会提供一些高级功能,例如 ESP Payloads 的 Decryption 和/或 Authentication Checking。

目前它会考虑以下 encryption Algorithms:

  • NULL Encryption。

  • TripleDES-CBC RFC2451,key length 为 192 bits。

  • AES-CBC with 128-bit keys RFC3602,key length 为 128/192/256 bits。

  • AES-CTR RFC3686,key length 为 160/224/288 bits。剩余 32 bits 将用作 nonce。

  • DES-CBC RFC2405,key length 为 64 bits。

  • BLOWFISH-CBC RFC2451,key length 仅为 128 bits。

  • TWOFISH-CBC,key 为 128/256 bits。

它还允许针对以下 Algorithms 检查 Authentication:

  • NULL Authentication。

  • HMAC-SHA1-96 RFC2404:任意 keylen

  • HMAC-MD5-96 RFC2403:任意 keylen

  • HMAC-SHA256:任意 keylen

首选项设置

若要能够解密 ESP Payload 或检查 ESP Authenticator,您需要向 Wireshark 的 ESP Preferences Menu 提供相应元素(参见 ESP_Preferences)。

示例捕获文件

一些带有所用 Security Associations 的示例捕获文件可在此处获得:

  • SampleCaptures/ipsec_esp_capture_1.tgz

用于 v4/v6 中简单 transport mode 的 ESP payload Decryption 和 Authentication Checking 示例。

  • SampleCaptures/ipsec_esp_capture_2.tgz

用于 v4 中 tunnel mode 的 ESP payload Decryption 和 Authentication Checking 示例。

  • SampleCaptures/ipsec_esp_capture_3.tgz

对 RFC4305 中未定义的更多 Encryption Algorithms 进行 ESP payload Decryption with Authentication Checking 的示例。

  • SampleCaptures/ipsec_esp_capture_4.tgz

不进行 Decryption、仅对 HMAC-MD5-96 [RFC2403] / HMAC-SHA1-96 [RFC2404] / Null Authentication 进行 ESP Authentication Checking 的示例。

  • SampleCaptures/ipsec_esp_capture_5.tgz

使用 Hexadecimal keys 进行 Authentication Checking 和 Decryption 的示例。

Imported from https://wiki.wireshark.org/ESP on 2020-08-11 23:13:50 UTC

相关 Wireshark Wiki 页面

网络分析技术档案