Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
PcapPlusPlus — 跨平台C++库,用于高性能网络数据包捕获、解析、构建和分析。支持libpcap、DPDK、AF_XDP、PF_RING,并包含TCP重组、TLS指纹识别和协议解码。 | Kitploit
工具/GitHubGitHub/seladb/pcapplusplus
数据包嗅探与分析网络映射网络取证取证分析网络安全实用工具与框架网络爬虫DNS 分析网络取证 分类第 14 名数据包嗅探与分析 分类第 12 名
3.1k7511152天前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
GitHubseladb/pcapplusplus

PcapPlusPlus

跨平台C++库,用于高性能网络数据包捕获、解析、构建和分析。支持libpcap、DPDK、AF_XDP、PF_RING,并包含TCP重组、TLS指纹识别和协议解码。

查看仓库网站
> ⚠️ **注意:** 本翻譯由 AI 協助維護與同步,可能與最新的英文版本存在差異。若您發現任何錯誤,歡迎開立 GitHub issue 或提交 PR。

<div align="center">

[![PcapPlusPlus 標誌](https://assets.kitploit.com/production/public/readmes/1341/435af5165c15d014098169a01e498becc2228cae9cbdf6c16e00003325a7129a.png)](https://pcapplusplus.github.io)

[![GitHub 工作流程狀態](https://img.shields.io/github/actions/workflow/status/seladb/PcapPlusPlus/build_and_test.yml?branch=master&label=Actions&logo=github&style=flat)](https://github.com/seladb/PcapPlusPlus/actions?query=workflow%3A%22Build+and+test%22)
[![GitHub 工作流程狀態](https://img.shields.io/github/actions/workflow/status/seladb/PcapPlusPlus/codeql.yml?branch=master&label=CodeQL&logo=github&style=flat)](https://github.com/seladb/PcapPlusPlus/actions?query=workflow%3A%22CodeQL%22)
[![Codecov](https://img.shields.io/codecov/c/github/seladb/PcapPlusPlus?logo=codecov&logoColor=white)](https://app.codecov.io/github/seladb/PcapPlusPlus)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/seladb/PcapPlusPlus/badge)](https://scorecard.dev/viewer/?uri=github.com/seladb/PcapPlusPlus)
[![GitHub 貢獻者](https://img.shields.io/github/contributors/seladb/PcapPlusPlus?style=flat&label=Contributors&logo=github)](https://github.com/seladb/PcapPlusPlus/graphs/contributors)

[![X 關注](https://img.shields.io/badge/follow-@seladb-1DA1F2?logo=x&style=social)](https://x.com/intent/follow?screen_name=seladb)
[![GitHub Repo 星星](https://img.shields.io/github/stars/seladb/PcapPlusPlus?style=social)]()

</div>

[PcapPlusPlus](https://pcapplusplus.github.io/) 是一個跨平台的 C++ 函式庫,提供高效、強大且易於使用的功能,來進行網路封包的擷取、解析和生成。

PcapPlusPlus 支援對多種網路協議進行解析和建構,並對常見的封包處理函式庫(如 [libpcap](https://www.tcpdump.org/)、[WinPcap](https://www.winpcap.org/)、[Npcap](https://nmap.org/npcap/)、[DPDK](https://www.dpdk.org/)、[eBPF AF_XDP](https://www.kernel.org/doc/html/next/networking/af_xdp.html)、[WinDivert](https://reqrypt.org/windivert.html) 和 [PF_RING](https://www.ntop.org/products/packet-capture/pf_ring/))提供 C++ 的封裝函式。

翻譯: [English](https://github.com/seladb/pcapplusplus/blob/master/README.md) · 正體中文 · [한국어](https://github.com/seladb/pcapplusplus/blob/master/translation/README-kor.md) · [日本語](https://github.com/seladb/pcapplusplus/blob/master/translation/README-ja.md) · [Русский](https://github.com/seladb/pcapplusplus/blob/master/translation/README-rus.md)

## 目錄

- [目錄](#目錄)
- [下載](#下載)
  - [GitHub 發佈頁面](#github-發佈頁面)
  - [Homebrew](#homebrew)
  - [Vcpkg](#vcpkg)
  - [Conan](#conan)
  - [自行建置](#自行建置)
  - [驗證您的套件](#驗證您的套件)
- [功能概述](#功能概述)
- [快速入門](#快速入門)
- [API 文件](#api-文件)
- [跨平台支援](#跨平台支援)
- [支援的網路協定](#支援的網路協定)
  - [資料連接層 (L2)](#資料連接層-l2)
  - [網路層 (L3)](#網路層-l3)
  - [傳輸層 (L4)](#傳輸層-l4)
  - [對話層 (L5)](#對話層-l5)
  - [表示層 (L6)](#表示層-l6)
  - [應用層 (L7)](#應用層-l7)
- [DPDK 和 PF_RING 支援](#dpdk-和-pf_ring-支援)
- [基準測試](#基準測試)
- [提供回饋](#提供回饋)
- [貢獻](#貢獻)
- [授權條款](#授權條款)

## 下載

您可以從 GitHub 發佈頁面下載,使用套件管理器來下載,或自行建構 PcapPlusPlus。更多詳情請參考 [下載](https://pcapplusplus.github.io/docs/install) 頁面。

[![GitHub 全部下載](https://img.shields.io/github/downloads/seladb/PcapPlusPlus/total?style=flat&label=Downloads&logo=github)](https://tooomm.github.io/github-release-stats/?username=seladb&repository=PcapPlusPlus)

### GitHub 發佈頁面

<https://github.com/seladb/PcapPlusPlus/releases/latest>

### Homebrew

```shell
brew install pcapplusplus
```

Homebrew 套件頁面: <https://formulae.brew.sh/formula/pcapplusplus>

### Vcpkg

Windows:

```text
.\vcpkg install pcapplusplus
```

MacOS/Linux:

```text
vcpkg install pcapplusplus
```

Vcpkg 套件頁面: <https://github.com/microsoft/vcpkg/tree/master/ports/pcapplusplus>

### Conan

```text
conan install "pcapplusplus/[>0]@" -u
```

Conan 套件頁面: <https://conan.io/center/pcapplusplus>

### 自行建置

取得 git repo:

```shell
git clone https://github.com/seladb/PcapPlusPlus.git
```

根據您的平台,請遵循 [從原始碼建置](https://pcapplusplus.github.io/docs/install#build-from-source) 頁面中的指示進行建置。

### 驗證您的套件

PcapPlusPlus 發佈的版本自 v23.09 以後都已通過 GitHub 驗證簽署。所有的驗證文件都可以在 [這裡](https://github.com/seladb/PcapPlusPlus/attestations) 找到。您可以使用 GitHub CLI 驗證這些套件的簽署。要驗證套件,您可以參考 [gh attestation verify](https://cli.github.com/manual/gh_attestation_verify) 的最新說明。以下是簡單的操作命令:

```shell
gh attestation verify <path-to-package-file> --repository seladb/PcapPlusPlus
```

執行後,您應該會在終端機中看到以下輸出:

```shell
✓ Verification succeeded!
```

## 功能概述

- __封包捕獲__:提供簡單易用的 C++ 封裝函式來使用常見的封包捕獲引擎,如 [libpcap](https://www.tcpdump.org/)、[WinPcap](https://www.winpcap.org/)、[Npcap](https://nmap.org/npcap/)、[Intel DPDK](https://www.dpdk.org/)、[eBPF AF_XDP](https://www.kernel.org/doc/html/next/networking/af_xdp.html)、[WinDivert](https://reqrypt.org/windivert.html)、[ntop 的 PF_RING](https://www.ntop.org/products/packet-capture/pf_ring/) 以及 [raw sockets](https://en.wikipedia.org/wiki/Network_socket#Raw_socket) [[了解更多](https://pcapplusplus.github.io/docs/features#packet-capture)]
- __解析與建構__:包含網路協定解析、網路封包建構與編輯,支援各種類型的 [網路協定](https://pcapplusplus.github.io/docs/features#supported-network-protocols) [[了解更多](https://pcapplusplus.github.io/docs/features#packet-parsing-and-crafting)]
- __從檔案讀寫封包__:支援 __PCAP__ 和 __PCAPNG__ 格式 [[了解更多](https://pcapplusplus.github.io/docs/features#read-and-write-packets-fromto-files)]
- __封包處理__:以線性速度提供高效且易用的 C++ 封裝函式來使用 [DPDK](https://www.dpdk.org/)、[eBPF AF_XDP](https://www.kernel.org/doc/html/next/networking/af_xdp.html) 和 [PF_RING](https://www.ntop.org/products/packet-capture/pf_ring/) [[了解更多](https://pcapplusplus.github.io/docs/features#dpdk-support)]
- __多平台支援__:PcapPlusPlus 完全支援 Linux、MacOS、Windows、Android 和 FreeBSD
- __封包重組__:包含 __TCP 重組__ 的獨特實現,處理 TCP 重傳、亂序的 TCP 封包及遺失的 TCP 資料,並支援 __IP 分片與重組__,可生成並重組 IPv4 和 IPv6 的分片 [[了解更多](https://pcapplusplus.github.io/docs/features#packet-reassembly)]
- __封包過濾__:讓 libpcap 的 BPF 過濾器變得更加易用 [[了解更多](https://pcapplusplus.github.io/docs/features#packet-filtering)]
- __TLS 指紋識別__:C++ 實現的 [JA3 和 JA3S](https://github.com/salesforce/ja3) TLS 指紋識別 [[了解更多](https://pcapplusplus.github.io/docs/features#tls-fingerprinting)]

## 快速入門

使用 PcapPlusPlus 編寫應用程式非常簡單且直觀。以下是一個簡單的應用程式,展示了如何從 PCAP 檔案讀取封包並解析它:

```cpp
#include <iostream>
#include "IPv4Layer.h"
#include "Packet.h"
#include "PcapFileDevice.h"

int main(int argc, char* argv[])
{
    // 打開一個 pcap 檔案進行讀取
    pcpp::PcapFileReaderDevice reader("1_packet.pcap");
    if (!reader.open())
    {
        std::cerr << "打開 pcap 檔案時出錯" << std::endl;
        return 1;
    }

    // 從檔案中讀取第一個(也是唯一的)封包
    pcpp::RawPacket rawPacket;
    if (!reader.getNextPacket(rawPacket))
    {
        std::cerr << "無法讀取檔案中的第一個封包" << std::endl;
        return 1;
    }

    // 將原始封包解析為已解析的封包
    pcpp::Packet parsedPacket(&rawPacket);

    // 確認封包是 IPv4 封包
    if (parsedPacket.isPacketOfType(pcpp::IPv4))
    {
        // 提取源 IP 和目的 IP
        pcpp::IPv4Address srcIP = parsedPacket.getLayerOfType<pcpp::IPv4Layer>()->getSrcIPv4Address();
        pcpp::IPv4Address destIP = parsedPacket.getLayerOfType<pcpp::IPv4Layer>()->getDstIPv4Address();

        // 輸出源 IP 和目的 IP
        std::cout << "來源 IP: '" << srcIP << "'; 目的 IP: '" << destIP << "'" << std::endl;
    }

    // 關閉檔案
    reader.close();

    return 0;
}
```

您可以在 PcapPlusPlus 網站的 [快速入門指南](https://pcapplusplus.github.io/docs/quickstart) 中找到更多資訊。該頁面會帶您通過幾個簡單的步驟,讓您的應用程式快速運行起來。

## API 文件

PcapPlusPlus 包含三個函式庫:

1. __Packet++__ - 用於解析、創建和編輯網路封包的函式庫
2. __Pcap++__ - 用於攔截和發送封包、提供網路和網卡資訊、統計等功能的函式庫。實際上是對封包擷取引擎(如 libpcap、WinPcap、Npcap、DPDK、AF_XDP、WinDivert 和 PF_RING)的 C++ 封裝
3. __Common++__ - 包含 Packet++ 和 Pcap++ 共用的一些通用程式碼工具函式庫

您可以在 PcapPlusPlus 網站的 [API 文件區](https://pcapplusplus.github.io/docs/api) 找到詳細的 API 文件。如果您發現有任何遺漏的資料,請[聯繫我們](#提供回饋)。

## 跨平台支援

PcapPlusPlus 目前支援以下平台:
__Windows__
<picture>
  <img src="https://assets.kitploit.com/production/public/readmes/1341/c9d4d39ae50048d8ce2cbfa11c868ad57b740d5ed4e1a4fc16f441a6c9c9eb82.png" alt="" width="16" height="16"/>
</picture>,
__Linux__
<picture>
  <img src="https://assets.kitploit.com/production/public/readmes/1341/5f686f6ed92d40cd40dba7afc2294c712049c9fc57f0cf04499c1ee281e4bff0.png" alt="" width="16" height="16"/>
</picture>,
__MacOS__
<picture><source media="(prefers-color-scheme: dark)" srcset="https://github.com/PcapPlusPlus/pcapplusplus.github.io/raw/master/static/img/os-logos/logo-apple-dark.png"/>
  <img src="https://assets.kitploit.com/production/public/readmes/1341/39b45d85d90bd8ee79131d5c3b91385be2449078e5abc46631fe0e57073609ec.png" alt="" width="16" height="16"/>
</picture>,
__Android__
<picture>
  <img src="https://assets.kitploit.com/production/public/readmes/1341/53240c69de91ce8cf2d98355bb05d7efa639fbd61b92a4791cd452698bd4e4c3.png" alt="" width="16" height="16"/>
</picture> 和
__FreeBSD__
<picture>
  <img src="https://assets.kitploit.com/production/public/readmes/1341/e7ea28abb644711562db941f556de2c0d7b8ee7357470ba92f11245356f46701.png" alt="" width="16" height="16"/>
</picture>。
請訪問 PcapPlusPlus 網站查看所有[支援的平台](https://pcapplusplus.github.io/docs/platforms),並參考[下載](#下載)區開始在您的平台上使用 PcapPlusPlus。

## 支援的網路協定

PcapPlusPlus 目前支援解析、編輯和建構以下網路協定的封包:

### 資料連接層 (L2)

1. Cisco HDLC
2. Ethernet II
3. IEEE 802.3 Ethernet
4. LLC(僅支援 BPDU)
5. Null/Loopback
6. Packet trailer(又稱 footer 或 padding)
7. PPPoE
8. SLL(Linux 擷取協定)
9. SLL2(Linux 擷取協定 v2)
10. STP
11. VLAN
12. VXLAN
13. Wake on LAN (WoL)
14. NFLOG(Linux Netfilter NFLOG)- 僅支援解析(不支援編輯)

### 網路層 (L3)

15. ARP
16. GRE
17. ICMP
18. ICMPv6
19. IGMP(支援 IGMPv1、IGMPv2 和 IGMPv3)
20. IPv4
21. IPv6
22. MPLS
23. NDP
24. Raw IP(IPv4 和 IPv6)
25. VRRP(IPv4 和 IPv6)
26. WireGuard

### 傳輸層 (L4)

27. COTP
28. GTP (v1 & v2)
29. IPSec AH 和 ESP - 僅支援解析(不支援編輯)
30. TCP
31. TPKT
32. UDP

### 對話層 (L5)

33. SDP
34. SIP

### 表示層 (L6)

35. SSL/TLS - 僅支援解析(不支援編輯)

### 應用層 (L7)

36. ASN.1 編碼器與解碼器
37. BGP (v4)
38. 加密金鑰解碼器
39. DHCP
40. DHCPv6
41. DNS
42. DoIP
43. FTP
44. HTTP 標頭(請求和響應)
45. LDAP
46. Modbus
47. MySQL - 僅支援解析(不支援編輯)
48. NTP (v3, v4)
49. PEM 編碼器與解碼器
50. PostgreSQL Wire Protocol (PGWire) - 僅支援解析(不支援編輯)
51. Radius
52. S7 通訊(S7comm)
53. SMTP
54. SOME/IP
55. SSH - 僅支援解析(不支援編輯)
56. Telnet - 僅支援解析(不支援編輯)
57. X509 憑證 - 僅支援解析(不支援編輯)
58. 通用酬載(Generic Payload)

## DPDK 和 PF_RING 支援

[DPDK (The Data Plane Development Kit)](https://www.dpdk.org/) 是一套用於高速封包處理的資料平面函式庫和網路介面卡驅動。

[PF_RING™](https://www.ntop.org/products/packet-capture/pf_ring/) 是一種新型網路套接字,能顯著提升封包擷取速度。

這兩個框架提供了非常快速的封包處理(幾乎是線性的),並廣泛應用於路由器、防火牆、負載平衡器等網路應用中。PcapPlusPlus 提供了對 DPDK 和 PF_RING 的 C++ 抽象層,這個抽象層簡化了使用這些框架的繁瑣流程。您可以在 PcapPlusPlus 網站的 [DPDK](https://pcapplusplus.github.io/docs/dpdk) 和 [PF_RING](https://pcapplusplus.github.io/docs/features#pf_ring-support) 支援頁面了解更多資訊。

## 基準測試

我們使用了 Matias Fontanini 的 [packet-capture-benchmarks](https://github.com/mfontanini/packet-capture-benchmarks) 專案來比較 PcapPlusPlus 與其他類似的 C++ 函式庫(如 `libtins` 和 `libcrafter`)的效能。

您可以在 PcapPlusPlus 網站的 [基準測試](https://pcapplusplus.github.io/docs/benchmark) 頁面查看測試結果。

## 提供回饋

我們非常樂意收到您的回饋,請通過以下任一方式與我們聯繫:

- 在 GitHub 上提交問題
- 在 PcapPlusPlus 的 Google 群組發佈訊息: <https://groups.google.com/d/forum/pcapplusplus-support>
- 在 Stack Overflow 上提問: <https://stackoverflow.com/questions/tagged/pcapplusplus>
- 發送電子郵件至: <[email protected]>
- 在 X 平台關注我們: <https://x.com/seladb>

如果您喜歡這個專案,請在 GitHub 上為我們按下星星 — 這對我們非常有幫助! :star: :star:

請訪問 [PcapPlusPlus 網站](https://pcapplusplus.github.io/community) 瞭解更多資訊。

## 貢獻

我們非常感謝您對此專案的任何貢獻。如果您有興趣參與貢獻,請訪問 PcapPlusPlus 網站上的 [貢獻頁面](https://pcapplusplus.github.io/community#contribute)。

## 授權條款

PcapPlusPlus 是根據 [Unlicense 授權條款](https://choosealicense.com/licenses/unlicense/) 發佈的。

[![GitHub](https://img.shields.io/github/license/seladb/PcapPlusPlus?style=flat&color=blue&logo=unlicense)](https://choosealicense.com/licenses/unlicense/)
下载工具