|
| 1 | +<div align="center"> |
| 2 | + |
| 3 | +[](https://pcapplusplus.github.io) |
| 4 | + |
| 5 | +[](https://github.com/seladb/PcapPlusPlus/actions?query=workflow%3A%22Build+and+test%22) |
| 6 | +[](https://github.com/seladb/PcapPlusPlus/actions?query=workflow%3A%22CodeQL%22) |
| 7 | +[](https://app.codecov.io/github/seladb/PcapPlusPlus) |
| 8 | +[](https://scorecard.dev/viewer/?uri=github.com/seladb/PcapPlusPlus) |
| 9 | +[](https://github.com/seladb/PcapPlusPlus/graphs/contributors) |
| 10 | + |
| 11 | +[](https://x.com/intent/follow?screen_name=seladb) |
| 12 | +[]() |
| 13 | + |
| 14 | +</div> |
| 15 | + |
| 16 | +[PcapPlusPlus](https://pcapplusplus.github.io/)는 네트워크 패킷을 캡처, 분석 및 생성하기 위한 멀티 플랫폼 C++ 라이브러리입니다. 이 라이브러리는 효율적이고 강력하며 사용이 용이하도록 설계되었습니다. |
| 17 | + |
| 18 | +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), [PF_RING](https://www.ntop.org/products/packet-capture/pf_ring/) 등과 같은 유용한 패킷 처리 엔진을 위한 손쉬운 C++ 래퍼를 지원합니다. |
| 19 | + |
| 20 | +번역: [English](../README.md) · [正體中文](./README-zh-tw.md) · 한국어 |
| 21 | + |
| 22 | +## 목차 |
| 23 | + |
| 24 | +- [목차](#목차) |
| 25 | +- [다운로드](#다운로드) |
| 26 | + - [GitHub 릴리스 페이지](#github-릴리스-페이지) |
| 27 | + - [Homebrew](#homebrew) |
| 28 | + - [Vcpkg](#vcpkg) |
| 29 | + - [Conan](#conan) |
| 30 | + - [직접 빌드하기](#직접-빌드하기) |
| 31 | + - [패키지 검증](#패키지-검증) |
| 32 | +- [기능 개요](#기능-개요) |
| 33 | +- [시작하기](#시작하기) |
| 34 | +- [API 문서](#api-문서) |
| 35 | +- [멀티 플랫폼 지원](#멀티-플랫폼-지원) |
| 36 | +- [지원되는 네트워크 프로토콜](#지원되는-네트워크-프로토콜) |
| 37 | + - [데이터 링크 계층 (L2)](#데이터-링크-계층-l2) |
| 38 | + - [네트워크 계층 (L3)](#네트워크-계층-l3) |
| 39 | + - [전송 계층 (L4)](#전송-계층-l4) |
| 40 | + - [세션 계층 (L5)](#세션-계층-l5) |
| 41 | + - [프레젠테이션 계층 (L6)](#프레젠테이션-계층-l6) |
| 42 | + - [응용 계층 (L7)](#응용-계층-l7) |
| 43 | +- [DPDK 및 PF_RING 지원](#dpdk-및-pf_ring-지원) |
| 44 | +- [벤치마크](#벤치마크) |
| 45 | +- [피드백 제공](#피드백-제공) |
| 46 | +- [기여](#기여) |
| 47 | +- [라이센스](#라이센스) |
| 48 | + |
| 49 | +## 다운로드 |
| 50 | + |
| 51 | +GitHub 릴리스 페이지에서 다운로드하거나 패키지 관리자를 사용할 수 있으며, 직접 PcapPlusPlus를 빌드할 수도 있습니다. 자세한 내용은 PcapPlusPlus 웹사이트의 [다운로드](https://pcapplusplus.github.io/docs/install) 페이지를 방문하세요. |
| 52 | + |
| 53 | +[](https://tooomm.github.io/github-release-stats/?username=seladb&repository=PcapPlusPlus) |
| 54 | + |
| 55 | +### GitHub 릴리스 페이지 |
| 56 | + |
| 57 | +<https://github.com/seladb/PcapPlusPlus/releases/latest> |
| 58 | + |
| 59 | +### Homebrew |
| 60 | + |
| 61 | +```shell |
| 62 | +brew install pcapplusplus |
| 63 | +``` |
| 64 | + |
| 65 | +Homebrew formulae: <https://formulae.brew.sh/formula/pcapplusplus> |
| 66 | + |
| 67 | +### Vcpkg |
| 68 | + |
| 69 | +Windows: |
| 70 | + |
| 71 | +```text |
| 72 | +.\vcpkg install pcapplusplus |
| 73 | +``` |
| 74 | + |
| 75 | +MacOS/Linux: |
| 76 | + |
| 77 | +```text |
| 78 | +vcpkg install pcapplusplus |
| 79 | +``` |
| 80 | + |
| 81 | +Vcpkg 포트: <https://github.com/microsoft/vcpkg/tree/master/ports/pcapplusplus> |
| 82 | + |
| 83 | +### Conan |
| 84 | + |
| 85 | +```text |
| 86 | +conan install "pcapplusplus/[>0]@" -u |
| 87 | +``` |
| 88 | + |
| 89 | +ConanCenter의 패키지: <https://conan.io/center/pcapplusplus> |
| 90 | + |
| 91 | +### 직접 빌드하기 |
| 92 | + |
| 93 | +git 리포지토리 클론: |
| 94 | + |
| 95 | +```shell |
| 96 | +git clone https://github.com/seladb/PcapPlusPlus.git |
| 97 | +``` |
| 98 | + |
| 99 | +PcapPlusPlus 웹사이트의 [소스에서 빌드](https://pcapplusplus.github.io/docs/install#build-from-source) 페이지에서 플랫폼에 맞는 빌드 지침을 따르세요. |
| 100 | + |
| 101 | +### 패키지 검증 |
| 102 | + |
| 103 | +v23.09 이상의 PcapPlusPlus 릴리스는 GitHub 증명을 통해 서명됩니다. 모든 증명은 [여기](https://github.com/seladb/PcapPlusPlus/attestations)에서 확인할 수 있습니다. GitHub CLI를 통해 이러한 패키지의 증명을 검증할 수 있습니다. 패키지 검증을 위해 다음 명령어를 사용할 수 있습니다: |
| 104 | + |
| 105 | +```shell |
| 106 | +gh attestation verify <패키지 파일 경로> --repository seladb/PcapPlusPlus |
| 107 | +``` |
| 108 | + |
| 109 | +터미널에 다음과 같은 출력이 나타납니다: |
| 110 | + |
| 111 | +```shell |
| 112 | +✓ Verification succeeded! |
| 113 | +``` |
| 114 | + |
| 115 | +## 기능 개요 |
| 116 | + |
| 117 | +- __패킷 캡처__: [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), [ntop의 PF_RING](https://www.ntop.org/products/packet-capture/pf_ring/) 및 [raw 소켓](https://en.wikipedia.org/wiki/Network_socket#Raw_socket)을 위한 손쉬운 C++ 래퍼를 통한 패킷 캡처 [[더 알아보기](https://pcapplusplus.github.io/docs/features#packet-capture)] |
| 118 | +- __패킷 분석 및 생성__: 다양한 [네트워크 프로토콜](https://pcapplusplus.github.io/docs/features#supported-network-protocols)에 대한 분석, 생성 및 편집을 지원 [[더 알아보기](https://pcapplusplus.github.io/docs/features#packet-parsing-and-crafting)] |
| 119 | +- __파일로 패킷 읽기 및 쓰기__: __PCAP__ 및 __PCAPNG__ 형식의 파일을 지원 [[더 알아보기](https://pcapplusplus.github.io/docs/features#read-and-write-packets-fromto-files)] |
| 120 | +- __라인 속도에서의 패킷 처리__: [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/)을 위한 효율적이고 쉬운 C++ 래퍼 [[더 알아보기](https://pcapplusplus.github.io/docs/features#dpdk-support)] |
| 121 | +- __멀티 플랫폼 지원__: Linux, MacOS, Windows, Android 및 FreeBSD에서 완전 지원 |
| 122 | +- __패킷 재조합__: __TCP 재조합__ 및 __IP 단편화와 재조합__ [[더 알아보기](https://pcapplusplus.github.io/docs/features#packet-reassembly)] |
| 123 | +- __패킷 필터링__: libpcap의 BPF 필터를 더 간편하게 사용 [[더 알아보기](https://pcapplusplus.github.io/docs/features#packet-filtering)] |
| 124 | + |
| 125 | +## 시작하기 |
| 126 | + |
| 127 | +PcapPlusPlus로 애플리케이션을 작성하는 것은 매우 쉽고 직관적입니다. 아래는 PCAP 파일에서 패킷을 읽고 이를 파싱하는 간단한 예제 애플리케이션입니다: |
| 128 | + |
| 129 | +```cpp |
| 130 | +#include <iostream> |
| 131 | +#include "IPv4Layer.h" |
| 132 | +#include "Packet.h" |
| 133 | +#include "PcapFileDevice.h" |
| 134 | + |
| 135 | +int main(int argc, char* argv[]) |
| 136 | +{ |
| 137 | + // PCAP 파일을 읽기 모드로 열기 |
| 138 | + pcpp::PcapFileReaderDevice reader("1_packet.pcap"); |
| 139 | + if (!reader.open()) |
| 140 | + { |
| 141 | + std::cerr << "PCAP 파일을 여는 중 오류 발생" << std::endl; |
| 142 | + return 1; |
| 143 | + } |
| 144 | + |
| 145 | + // 파일에서 첫 번째 (단일) 패킷 읽기 |
| 146 | + pcpp::RawPacket rawPacket; |
| 147 | + if (!reader.getNextPacket(rawPacket)) |
| 148 | + { |
| 149 | + std::cerr << "파일에서 첫 번째 패킷을 읽을 수 없음" << std::endl; |
| 150 | + return 1; |
| 151 | + } |
| 152 | + |
| 153 | + // raw 패킷을 파싱된 패킷으로 변환 |
| 154 | + pcpp::Packet parsedPacket(&rawPacket); |
| 155 | + |
| 156 | + // 패킷이 IPv4인지 확인 |
| 157 | + if (parsedPacket.isPacketOfType(pcpp::IPv4)) |
| 158 | + { |
| 159 | + // 소스 및 대상 IP 추출 |
| 160 | + pcpp::IPv4Address srcIP = parsedPacket.getLayerOfType<pcpp::IPv4Layer>()->getSrcIPv4Address(); |
| 161 | + pcpp::IPv4Address destIP = parsedPacket.getLayerOfType<pcpp::IPv4Layer>()->getDstIPv4Address(); |
| 162 | + |
| 163 | + // 소스 및 대상 IP 출력 |
| 164 | + std::cout << "Source IP is '" << srcIP << "'; Dest IP is '" << destIP << "'" << std::endl; |
| 165 | + } |
| 166 | + |
| 167 | + // 파일 닫기 |
| 168 | + reader.close(); |
| 169 | + |
| 170 | + return 0; |
| 171 | +} |
| 172 | +``` |
| 173 | +
|
| 174 | +자세한 내용은 PcapPlusPlus 웹사이트의 [시작하기](https://pcapplusplus.github.io/docs/quickstart) 페이지에서 확인할 수 있습니다. 이 페이지는 애플리케이션을 빠르게 시작할 수 있는 단계별 안내를 제공합니다. |
| 175 | +
|
| 176 | +## API 문서 |
| 177 | +
|
| 178 | +PcapPlusPlus는 다음의 세 가지 라이브러리로 구성됩니다: |
| 179 | +
|
| 180 | +1. __Packet++__ - 네트워크 패킷을 파싱하고 생성 및 편집하는 라이브러리 |
| 181 | +2. __Pcap++__ - 패킷을 캡처하고 전송하며 네트워크 및 NIC 정보, 통계를 제공하는 라이브러리 (libpcap, WinPcap, Npcap, DPDK, PF_RING 등과 같은 패킷 캡처 엔진을 위한 C++ 래퍼) |
| 182 | +3. __Common++__ - Packet++ 및 Pcap++에서 사용하는 일반적인 코드 유틸리티를 포함한 라이브러리 |
| 183 | +
|
| 184 | +PcapPlusPlus 웹사이트의 [API 문서 섹션](https://pcapplusplus.github.io/docs/api)에서 자세한 API 문서를 확인할 수 있습니다. |
| 185 | +
|
| 186 | +## 멀티 플랫폼 지원 |
| 187 | +
|
| 188 | +PcapPlusPlus는 현재 __Windows__, __Linux__, __MacOS__, __Android__, __FreeBSD__에서 지원됩니다. PcapPlusPlus 웹사이트에서 [지원 플랫폼](https://pcapplusplus.github.io/docs/platforms) 전체 목록을 확인할 수 있으며, [다운로드](#download) 섹션을 참조하여 해당 플랫폼에서 PcapPlusPlus를 시작하세요. |
| 189 | +
|
| 190 | +## 지원되는 네트워크 프로토콜 |
| 191 | +
|
| 192 | +PcapPlusPlus는 현재 다음 프로토콜의 패킷을 파싱, 편집 및 생성할 수 있습니다: |
| 193 | +
|
| 194 | +### 데이터 링크 계층 (L2) |
| 195 | +
|
| 196 | +1. Ethernet II |
| 197 | +2. IEEE 802.3 Ethernet |
| 198 | +3. LLC (BPDU만 지원) |
| 199 | +4. Null/Loopback |
| 200 | +5. Packet trailer (패킷 패딩) |
| 201 | +6. PPPoE |
| 202 | +7. SLL (Linux cooked capture) |
| 203 | +8. SLL2 (Linux cooked capture v2) |
| 204 | +9. STP |
| 205 | +10. VLAN |
| 206 | +11. VXLAN |
| 207 | +12. Wake on LAN (WoL) |
| 208 | +13. NFLOG (Linux Netfilter NFLOG) - 파싱만 가능 (편집 불가) |
| 209 | +
|
| 210 | +### 네트워크 계층 (L3) |
| 211 | +
|
| 212 | +14. ARP |
| 213 | +15. GRE |
| 214 | +16. ICMP |
| 215 | +17. ICMPv6 |
| 216 | +18. IGMP (IGMPv1, IGMPv2, IGMPv3 지원) |
| 217 | +19. IPv4 |
| 218 | +20. IPv6 |
| 219 | +21. MPLS |
| 220 | +22. NDP |
| 221 | +23. Raw IP (IPv4 & IPv6) |
| 222 | +24. VRRP (IPv4 & IPv6) |
| 223 | +25. WireGuard |
| 224 | +
|
| 225 | +### 전송 계층 (L4) |
| 226 | +
|
| 227 | +26. COTP |
| 228 | +27. GTP (v1) |
| 229 | +28. IPSec AH & ESP - 파싱만 가능 (편집 불가) |
| 230 | +29. TCP |
| 231 | +30. TPKT |
| 232 | +31. UDP |
| 233 | +
|
| 234 | +### 세션 계층 (L5) |
| 235 | +
|
| 236 | +32. SDP |
| 237 | +33. SIP |
| 238 | +
|
| 239 | +### 표현 계층 (L6) |
| 240 | +
|
| 241 | +34. SSL/TLS - 파싱만 가능 (편집 불가) |
| 242 | +
|
| 243 | +### 응용 계층 (L7) |
| 244 | +
|
| 245 | +35. ASN.1 인코더 및 디코더 |
| 246 | +36. BGP (v4) |
| 247 | +37. DHCP |
| 248 | +38. DHCPv6 |
| 249 | +39. DNS |
| 250 | +40. FTP |
| 251 | +41. HTTP 헤더 (요청 및 응답) |
| 252 | +42. LDAP |
| 253 | +43. NTP (v3, v4) |
| 254 | +44. Radius |
| 255 | +45. S7 Communication (S7comm) |
| 256 | +46. SMTP |
| 257 | +47. SOME/IP |
| 258 | +48. SSH - 파싱만 가능 (편집 불가) |
| 259 | +49. Telnet - 파싱만 가능 (편집 불가) |
| 260 | +50. 일반 페이로드 |
| 261 | +
|
| 262 | +## DPDK 및 PF_RING 지원 |
| 263 | +
|
| 264 | +[DPDK](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) 지원 페이지에서 확인하세요. |
| 265 | +
|
| 266 | +## 성능 벤치마크 |
| 267 | +
|
| 268 | +PcapPlusPlus는 다른 C++ 라이브러리(`libtins`, `libcrafter` 등)와 성능을 비교하기 위해 Matias Fontanini의 [packet-capture-benchmarks](https://github.com/mfontanini/packet-capture-benchmarks) 프로젝트를 사용했습니다. 성능 결과는 PcapPlusPlus 웹사이트의 [벤치마크](https://pcapplusplus.github.io/docs/benchmark) 페이지에서 확인할 수 있습니다. |
| 269 | +
|
| 270 | +## 피드백 제공 |
| 271 | +
|
| 272 | +피드백을 환영합니다. 다음 방법을 통해 연락해 주세요: |
| 273 | +
|
| 274 | +- GitHub 이슈 작성 |
| 275 | +- PcapPlusPlus Google 그룹에 메시지 게시: <https://groups.google.com/d/forum/pcapplusplus-support> |
| 276 | +- Stack Overflow에서 질문하기: <https://stackoverflow.com/questions/tagged/pcapplusplus> |
| 277 | + |
| 278 | +- X 팔로우하기: <https://x.com/seladb> |
| 279 | +
|
| 280 | +이 프로젝트가 마음에 드시면 __GitHub에서 Star를 눌러 주세요__ :star: :star: |
| 281 | +
|
| 282 | +자세한 내용은 [PcapPlusPlus 웹사이트](https://pcapplusplus.github.io/community)를 방문하여 확인할 수 있습니다. |
| 283 | +
|
| 284 | +## 기여하기 |
| 285 | +
|
| 286 | +이 프로젝트에 기여해 주신다면 감사하겠습니다. 기여에 관심이 있으시면 PcapPlusPlus 웹사이트의 [기여 페이지](https://pcapplusplus.github.io/community#contribute)를 방문해 주세요. |
| 287 | +
|
| 288 | +## 라이선스 |
| 289 | +
|
| 290 | +PcapPlusPlus는 [Unlicense 라이선스](https://choosealicense.com/licenses/unlicense/)로 제공됩니다. |
| 291 | +
|
| 292 | +[](https://choosealicense.com/licenses/unlicense/) |
0 commit comments