tsharkでSNIだけ抜き出す
tsharkでSNIを抜き出す方法を調べるのに手間取ったのでメモ.
実行例:hoge.pcapからSSL/TLSのClientHelloからSNIのみ抜き出す.
$ tshark -nr hoge.pcap -Y "ssl.handshake.type == 1" -T fields -e ip.dst -e ssl.handshake.extensions_server_name
オプションについて
- -r hoge.pcap : pcapファイル読み込み
- -n : 名前解決の無効
- -Y "表示フィルタ" : wiresharkの表示フィルタを適用.今回はClientHelloのみ表示.
- -T fields -e FIELD : 抜き出したいフィールドの指定
フィールドについて
フィールドの指定方法は以下を参照した.
Wireshark · Display Filter Reference: Secure Sockets Layer
Wireshark · Display Filter Reference: Index