1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

tshark で (Pre)-Master-Secret を使用し TLS (SSL) 通信のキャプチャを decrypt する

Last updated at Posted at 2020-08-28

手元に (Pre)-Master-Secret があるんだけど TLS (SSL) 通信を復号化したいと思うことはありませんか?しかもコマンドラインで。

ありますよね、そんな時は tls.keylog_file にファイルを指定してあげるだけ。以下の例では該当のオプションで (Pre)-Master-Secret のファイルを指定すると http の通信が見えるのがわかります。

$ tshark -2r ./test_http11.pcap -R "http"
$ tshark -2r ./test_http11.pcap -o tls.keylog_file:./pre_master_secret.txt -R "http"
    1   6.404119   10.0.11.20 → 10.0.11.115  HTTP 213 GET / HTTP/1.1
    2   6.405361  10.0.11.115 → 10.0.11.20   HTTP 514 HTTP/1.1 200 OK  (text/html)

ちなみに --export-files というオプションもあって暗号化されたファイルの復元ができたりもします。tshark 有能。

$ mkdir obj
$ tshark -Qr ./test.pcap -o tls.keylog_file:./sessionsecrets.pms --export-objects http,./obj
$ ls ./obj/
%2f
$ file ./obj/%2f
./obj/%2f: HTML document, ASCII text
$ cat ./obj/%2f
<html>
    <body>
        <h1>Hello, World!</h1>
    </body>
</html>

参照:
How to use (pre)-master-secret log file with tshark

TLS Encrypted

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?