Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Network ExtensionでiOSデバイス上で動くパケットキャプチャを作る

Network ExtensionでiOSデバイス上で動くパケットキャプチャを作る

Creating a packet capture app without a remote VPN server with a Network Extension framework.

Network Extensionおよびパケットキャプチャの概要
VPNの仕組み
Network Extensionを使って簡易VPNクライアントを実装する
パケットの構造と解析
パケットキャプチャを利用した実用的なツールの作成

Kishikawa Katsumi

September 18, 2021
Tweet

More Decks by Kishikawa Katsumi

Other Decks in Programming

Transcript

  1. Network Extensionͱ͸ NetworkExtension.framework͕ఏڙ͢ΔAPIʢൈਮʣ • WiFiઃఆ • NEHotspotCon fi gurationManager •

    NEHotspotHelper • ΧελϜVPN • NEPacketTunnelProvider • ίϯςϯπϑΟϧλ • NEFilterDataProvider • NEFilterControlProvider
  2. PacketTunnelProvider = TUN Interface + VPN Client • TUN, namely

    network TUNnel, simulates a network layer device and operates in layer 3 carrying IP packets. • TAP, namely network TAP, simulates a link layer device and operates in layer 2 carrying Ethernet frames. • TUN is used with routing. TAP can be used to create a user space network bridge.
  3. Wrap up • Network ExtensionΛ࢖͏ͱVPNΫϥΠΞϯτ͕࡞ΕΔ • VPNΫϥΠΞϯτ͸ͦͷੑ্࣭ύέοτΛݟΔඞཁ͕͋Δ • Charles Proxy

    for iOS͸VPNΛར༻ͯ͠ύέοτΩϟϓνϟΛ͍ͯ͠Δ • αϯϓϧ͕গͳ͘ɺͱ͔͔ͬΓ͸೉͍͕͠΍ͬͯΈΔͱָ͍͠ • ήʔϜΛαϙʔτ͢ΔπʔϧΛ࡞Δͱ͍͍͔΋ʁ
  4. References • AUCaptureʢઆ໌ʹ࢖༻ͨ͠ΞϓϦͷιʔείʔυʣ
 https://github.com/kishikawakatsumi/AUCapture • Network Extension, Part 1 -

    Introduction
 https://kean.blog/post/network-extensions-into • How Does VPN Work?
 https://kean.blog/post/networking-101 • VPN, Part 1: VPN Pro fi les
 https://kean.blog/post/vpn-con fi guration-manager • VPN, Part 2: Packet Tunnel Provider
 https://kean.blog/post/packet-tunnel-provider
  5. References • Network Extensions for the Modern Mac - WWDC19

    - Videos - Apple Developer
 https://developer.apple.com/videos/play/wwdc2019/714 • What's New in Network Extension and VPN - WWDC15 - Videos - Apple Developer
 https://developer.apple.com/videos/play/wwdc2015/717 • OpenVPNAdapterʢOpenVPNʹ઀ଓ͢ΔNetworkExtensionɻΩϟϓνϟͳͲ ͳ͠ʹಈ͔͚ͩ͢ͳΒ͜Ε͕Ұ൪؆୯ɻʣ
 https://github.com/ss-abramchuk/OpenVPNAdapter
  6. References • AmongUsProtocolʢSwiftͰಈ͘Among UsύέοτParserʣ
 https://github.com/kishikawakatsumi/AmongUsProtocol • Hex Packet Decoder
 https://hpd.gasmi.net/

    • Among Us Protocol Research
 https://github.com/codyphobe/among-us-protocol • Among Us Debugger
 https://amongus-debugger.vercel.app/