[ipsec][strongswan] 使用wireshark查看strongswan ipsec esp ikev1 ikev2的加密内容
姊妹篇:[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的加密内容的更多相关文章
- [https][tls] 如何使用wireshark查看tls/https加密消息--使用keylog
姊妹篇: [ipsec][strongswan] 使用wireshark查看strongswan ipsec esp ikev1 ikev2的加密内容 [https][tls] 如何使用wiresha ...
- tcpdump抓包和scp导出以及wireshark查看
[命令和工具] tcpdump scp wireshark (1)tcpdump sudo tcpdump -i eth0 -w /home/tcpdump/1.pcap host 10.214.1 ...
- [https][tls] 如何使用wireshark查看tls/https加密消息--使用私钥
之前总结了使用keylog进行https流量分析的方法: [https][tls] 如何使用wireshark查看tls/https加密消息--使用keylog 今天总结一下使用服务器端证书私钥进行h ...
- Wireshark 查看指定进程的网络包
Wireshark 查看指定进程的网络包 打开任务管理器,右键筛选列,选中PID(进程标识符): 找到该进程对应的PID,如1200: 在cmd中执行netstat -ano|findstr 1200 ...
- SQL点点滴滴_查看所有存储过程或视图的位置及内容
代码:select a.name,a.[type],b.[definition] from sys.all_objects a,sys.sql_modules b where a.is_ms_ship ...
- Visual Studio Code 帮助查看器,指定的用于安装帮助内容的位置无效,或者您无权访问该位置
今天有个C# 类库文件里面的属性想要了解下,想到了Vs的帮助文档,其实也就是微软的MSDN:提示帮助查看器,指定的用于安装帮助内容的位置无效,或者您无权访问该位置: 最近两天vs也没有更新,并且也没有 ...
- 下面哪些命令可以查看file1文件的第300-500行的内容?
下面哪些命令可以查看file1文件的第300-500行的内容? cat file1 | tail -n +300 | head -n 200 cat file1| head -n 500 | tail ...
- [ipsec] 特别硬核的ike/ipsec NAT穿越机制分析
〇 前言 这怕是最后一篇关于IKE,IPSEC的文字了,因为不能没完没了. 所以,我一直在想这个标题该叫什么.总的来说可以将其概括为:IKE NAT穿越机制的分析. 但是,同时它也回答了以下问题: ( ...
- Wireshark查看https的通讯
如果有服务端的证书,那我们可以分析web下https的通讯情况,在特别的场景下有一定的用处,如外部审计 如下是在wireshark或tshark中配置查看https的设置 wireshark验证 ts ...
随机推荐
- VMWare 鼠标无法点击 的问题
今日发现在VMWare虚拟机中点击鼠标没有反应,但是鼠标hover.键盘都是正常的. 还表现为,如果从外部环境激活鼠标,然后移至虚拟机区域,快速双击,则可以捕获为单击. 这个问题在网络上未见有明确解释 ...
- OpenCV掩模mask的原理和作用
一.什么是掩模mask OpenCV中很多函数都带有一个mask参数,mask被称为掩模.图像掩模一般用来对处理的图像(全部或者局部)进行遮挡,来控制图像处理的区域或处理过程. 二.掩模原理 掩模一般 ...
- MySQL问题汇总
1.中文乱码 连接设置: 数据库设置:
- MS SQL Server 查询元数据
use test -- 查询数据库中所有的表和架构名称select SCHEMA_NAME(schema_id) as table_schema_name, name as table_name fr ...
- Datagrip连接Mysql 和Hive
连接Mysql file->data source general 填写host,port,user,password, 下载驱动,先别test connection 在ssh中填写host,p ...
- 1、Filebeat概述
Filebeat是一个轻量级的日志托运工具,用于转发和集中日志数据. Filebeat作为代理安装在服务器上,监控指定的日志文件或目录,收集日志事件,并将它们转发到Elasticsearch或Logs ...
- VICA 架构设计
本文记录最近完成的一个通用实时通信客户端的架构. 背景 我们公司是做税务相关的软件,有针对大客户 MIS 系统,也有针对中小客户的 SaaS 平台.这些系统虽然都是 B/S 的,但是也需要使用 Act ...
- git 回滚远程服务端master的代码
1.先备份版本 git checkout master git pull git branch master_backup //备份一下这个分支当前的情况 git push origin master ...
- 如果往错误的NEO地址转账会发生什么
昨天聊天有人用NEO往错误地址转账丢钱了 我的第一反应是这不可能 Neo使用的地址带有验证功能 最下面ARPP-.G6ce这一串是个base58编码 把他解开就是17-.151f7b5f这一串 红 ...
- [POJ2965]The Pilots Brothers' refrigerator (搜索/位运算)
题意 游戏“The Pilots Brothers:跟随有条纹的大象”有一个玩家需要打开冰箱的任务. 冰箱门上有16个把手.每个手柄可以处于以下两种状态之一:打开或关闭.只有当所有把手都打开时,冰箱才 ...