Chinaunix首页 | 论坛 | 博客
  • 博客访问: 709482
  • 博文数量: 176
  • 博客积分: 2548
  • 博客等级: 少校
  • 技术积分: 1749
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-29 16:36
个人简介

爱咋咋地

文章分类

全部博文(176)

文章存档

2024年(1)

2023年(17)

2022年(19)

2021年(3)

2020年(1)

2018年(1)

2017年(1)

2014年(1)

2013年(4)

2012年(11)

2011年(19)

2010年(22)

2009年(71)

2008年(5)

分类: LINUX

2022-04-18 16:17:15

网上好多教程,用fiddler和burp suit的,感觉都很好。但我喜欢使用wireshark,不想再装其他软件了,网上查了一下使用wireshark也可以解析https。可能并不如前两个软件那么智能和方便,但wireshark支持的协议比较多,还支持http2。前两个据说不支持,不知道现在是否已经支持了。

最基本的步骤就是设置一个环境变量。我使用的fedora 35,windows据说也一样,我没有试过。

export SSLKEYLOGFILE=<一个有效的可以写入的文件路径>
然后打开wireshark。如果用sudo抓包,现在也需要用sudo 打开来进行设置啊。
Edit -> Perferences -> Protocols -> TLS 
红圈的地方填写(或选择)上面SSLKEYLOGFILE指向的文件路径。绿色是debug文件,不是必须的,只有在解析不了的情况下,设置上看看出了什么问题,获取一些额外信息。

点击OK, 然后,就木有然后了。

但你现在直接打开网页,大概率是不能解析正确的。

接下来把“所有浏览器”和wireshark全都关闭,全都关闭,全都关闭,重要事情说三遍。

首先,重新先打开wireshark,一定要先打开wireshark
$ sudo wireshark
然后点击开始抓包,只打开不行,必须开始抓包

再打开浏览器chrome或者firefox,这时候数据包应该已经自动解析出来了。


官方说明网址如下:
h**(tt)ps://wiki.wireshark.org/TLS#embedding-decryption-secrets-in-a-pcapng-file

摘抄其中的一段,可以把key文件和抓包文件合并在一起方便下次查看和使用,非常人性化
A key log file might contain keys that are not related to a capture file. To ensure that unnecessary keys are not leaked, you can use the inject-tls-secrets.py script from to filter the key log file and add the required secrets to a capture file. The shell script has been tested with Linux and macOS, but a Python 3 version is also available for all platforms including Windows. Example:

git clone h**(tt)ps://gist.github.com/Lekensteyn/f64ba6d6d2c6229d6ec444647979ea24 ~/its
~/its/inject-tls-secrets.py keys.txt some.pcap

(cublog在博文内不能贴网址这种破限制什么时候能去除啊)
阅读(1558) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~