姊妹篇:[https][tls] 如何使用wireshark查看tls/https加密消息

一,编译,启用strongswan的save-keys plugin

./configure --prefix=/root/OUTPUT --exec-prefix=/root/OUTPUT --enable-save-keys  CFLAGS="-g -O0"

运行之前验证一下,是否加载了这个插件

[root@T9 OUTPUT]# ./sbin/swanctl --stat |grep save
loaded plugins: charon aes save-keys des rc2 sha2 sha1 md5 mgf1 random nonce x509 revocation constraints pubkey
pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem fips-prf gmp curve25519 xcbc cmac hmac attr kernel-netlink
resolve socket-default stroke vici updown xauth-generic counters

二,增加如下配置

charon {
load_modular = yes
plugins {
include strongswan.d/charon/*.conf
save-keys {
esp = yes
ike = yes
load = yes
wireshark_keys = /root/OUTPUT/etc/keys
}
}

详细的解释,可以查man手册

       charon.plugins.save-keys.esp [no]
Whether to save ESP keys.
charon.plugins.save-keys.ike [no]
Whether to save IKE keys.
charon.plugins.save-keys.load [no]
Whether to load the plugin.
charon.plugins.save-keys.wireshark_keys []
Directory where the keys are stored in the format supported by Wireshark. IKEv1 keys are stored in the ikev1_decryption_table file.
IKEv2 keys are stored in the ikev2_decryption_table file.
Keys for ESP CHILD_SAs are stored in the esp_sa file.

三,正常运行之后,这个目录下,就会存着key了,同时把包抓下来

./sbin/swanctl --load-all
./sbin/ipsec up net-net

查看保存的key

[root@T9 OUTPUT]# ll etc/keys/
total
-rw-r--r-- root root Dec : esp_sa
-rw-r--r-- root root Dec : ikev2_decryption_table

四,配置wireshark

IKE:

edit->preferences->protocols->ISAKMP->IKEv2 Decryption Table->Edit

如图,看见这后边有个蓝色的文件名。

用前边获得的那个文件覆盖它。

cp ikev2_decryption_table /home/tong/.config/wireshark/ikev2_decryption_table

ESP:

edit->preferences->protocols->ESP->Edit

然后点加号,编辑

或者。直接cp进去到配置目录

cp esp_sa /home/tong/.config/wireshark/

五。用wirshark再次打开之前抓到的pcap包。

好了。现在的IKEV2和ESP都是解密过的了。

[ipsec][strongswan] 使用wireshark查看strongswan ipsec esp ikev1 ikev2的加密内容的更多相关文章

  1. [https][tls] 如何使用wireshark查看tls/https加密消息--使用keylog

    姊妹篇: [ipsec][strongswan] 使用wireshark查看strongswan ipsec esp ikev1 ikev2的加密内容 [https][tls] 如何使用wiresha ...

  2. tcpdump抓包和scp导出以及wireshark查看

    [命令和工具] tcpdump scp wireshark  (1)tcpdump sudo tcpdump -i eth0 -w /home/tcpdump/1.pcap host 10.214.1 ...

  3. [https][tls] 如何使用wireshark查看tls/https加密消息--使用私钥

    之前总结了使用keylog进行https流量分析的方法: [https][tls] 如何使用wireshark查看tls/https加密消息--使用keylog 今天总结一下使用服务器端证书私钥进行h ...

  4. Wireshark 查看指定进程的网络包

    Wireshark 查看指定进程的网络包 打开任务管理器,右键筛选列,选中PID(进程标识符): 找到该进程对应的PID,如1200: 在cmd中执行netstat -ano|findstr 1200 ...

  5. SQL点点滴滴_查看所有存储过程或视图的位置及内容

    代码:select a.name,a.[type],b.[definition] from sys.all_objects a,sys.sql_modules b where a.is_ms_ship ...

  6. Visual Studio Code 帮助查看器,指定的用于安装帮助内容的位置无效,或者您无权访问该位置

    今天有个C# 类库文件里面的属性想要了解下,想到了Vs的帮助文档,其实也就是微软的MSDN:提示帮助查看器,指定的用于安装帮助内容的位置无效,或者您无权访问该位置: 最近两天vs也没有更新,并且也没有 ...

  7. 下面哪些命令可以查看file1文件的第300-500行的内容?

    下面哪些命令可以查看file1文件的第300-500行的内容? cat file1 | tail -n +300 | head -n 200 cat file1| head -n 500 | tail ...

  8. [ipsec] 特别硬核的ike/ipsec NAT穿越机制分析

    〇 前言 这怕是最后一篇关于IKE,IPSEC的文字了,因为不能没完没了. 所以,我一直在想这个标题该叫什么.总的来说可以将其概括为:IKE NAT穿越机制的分析. 但是,同时它也回答了以下问题: ( ...

  9. Wireshark查看https的通讯

    如果有服务端的证书,那我们可以分析web下https的通讯情况,在特别的场景下有一定的用处,如外部审计 如下是在wireshark或tshark中配置查看https的设置 wireshark验证 ts ...

随机推荐

  1. Django之分页

    需要知道:每页多少条数据.一共多少条数据.一共需要多少页.每页从哪开始到哪结束 注意问题:1.用户输入页码为非数字.  2.用户输入页码超出页码范围 def books(request): try: ...

  2. MySql流程控制结构

    序号 结构名称 说明 1 顺序结构 程序从上往下依次执行 2 分支结构 程序从两条或多条路径中选择一条去执行 3 循环结构 程序在满足一定条件的基础上,重复执行一段代码 ⒈顺序结构 你啥都不干默认就是 ...

  3. Web从入门到放弃<2>

    <添加debug-toolbar> django现在1.11是必须这么做: pip install django-debug-toolbar 设置1: INSTALLED_APPS = [ ...

  4. jquery前端倒计时

    function FreshTime(){ // var endtime=new Date("2019/04/15,12:20:12");//结束时间 var endtime = ...

  5. 我实在不懂Python的Asyncio

    原语 事件循环(Event Loop) Awaitables和Coroutines Coroutine Wrappers Awaitables and Futures Tasks Handles Ex ...

  6. Python爬虫基础之Urllib

    一.随时随地爬取一个网页下来 怎么爬取网页?对网站开发了解的都知道,浏览器访问Url向服务器发送请求,服务器响应浏览器请求并返回一堆HTML信息,其中包括html标签,css样式,js脚本等.Chro ...

  7. 【原创】大叔问题定位分享(11)Spark中对大表子查询加limit为什么会报Broadcast超时错误

    当两个表需要join时,如果一个是大表,一个是小表,正常的map-reduce流程需要shuffle,这会导致大表数据在节点间网络传输,常见的优化方式是将小表读到内存中并广播到大表处理,避免shuff ...

  8. Array数组小方法总结

    如果各位在阅读的时候,有任何问题,都可以留言: // push()方法会向数据末尾添加数据,并返回添加数据后的数组的长度var arr=[1,2,3]console.log(arr.push(4),a ...

  9. SQL允许脏读WITH(NOLOCK)

    使用WIHT(NOLOCK)有利也有弊,所以在决定使用之前,你一定需要了解清楚WITH(NOLOCK)的功能和缺陷,看其是否适合你的业务需求,不要觉得它能提升性能,稀里糊涂的就使用它. --事务未提交 ...

  10. matplotlib散点数据-【老鱼学matplotlib】

    之前我们一直在讲述线段图,这次讲述散点图. 散点图的生成很简单,只要调用plt.scatter()函数就可以. 例如: import numpy as np import pandas as pd i ...